Function virtualization facility for function query of a processor

ABSTRACT

Selected installed function of a multi-function instruction is hidden such that even though a processor is capable of performing the hidden installed function, the availability of the hidden function is hidden such that responsive to the multi-function instruction querying the availability of functions, only functions not hidden are reported as installed.

FIELD OF THE INVENTION

The present invention is related to computer systems and moreparticularly to computer system processor instruction functionality.

BACKGROUND

Trademarks: IBM® is a registered trademark of International BusinessMachines Corporation, Armonk, N.Y., U.S.A. S/390, z900, z990 and z10 andother product names may be registered trademarks or product names ofInternational Business Machines Corporation or other companies.

IBM has created through the work of many highly talented engineersbeginning with machines known as the IBM® System 360 in the 1960s to thepresent, a special architecture which, because of its essential natureto a computing system, became known as “the mainframe” whose principlesof operation state the architecture of the machine by describing theinstructions which may be executed upon the “mainframe” implementationof the instructions which had been invented by IBM inventors andadopted, because of their significant contribution to improving thestate of the computing machine represented by “the mainframe”, assignificant contributions by inclusion in IBM's Principles of Operationas stated over the years. The Eighth Edition of the IBM® z/Architecture®Principles of Operation which was published February, 2009 has becomethe standard published reference as SA22-7832-07 and is incorporated inIBM's z100 mainframe servers. The IBM Z/Architecture® Principles ofOperation, Publication SA22-7832-07 is incorporated by reference in itsentirety herein.

Referring to FIG. 1A, representative components of a prior art HostComputer system 50 are portrayed. Other arrangements of components mayalso be employed in a computer system, which are well known in the art.The representative Host Computer 50 comprises one or more CPUs 1 incommunication with main store (Computer Memory 2) as well as I/Ointerfaces to storage devices 11 and networks 10 for communicating withother computers or SANs and the like. The CPU 1 is compliant with anarchitecture having an architected instruction set and architectedfunctionality. The CPU 1 may have Dynamic Address Translation (DAT) 3for transforming program addresses (virtual addresses) into real addressof memory. A DAT typically includes a Translation Lookaside Buffer (TLB)7 for caching translations so that later accesses to the block ofcomputer memory 2 do not require the delay of address translation.Typically a cache 9 is employed between Computer Memory 2 and theProcessor 1. The cache 9 may be hierarchical having a large cacheavailable to more than one CPU and smaller, faster (lower level) cachesbetween the large cache and each CPU. In some implementations the lowerlevel caches are split to provide separate low level caches forinstruction fetching and data accesses. In an embodiment, an instructionis fetched from memory 2 by an instruction fetch unit 4 via a cache 9.The instruction is decoded in an instruction decode unit 6 anddispatched (with other instructions in some embodiments) to instructionexecution units 8. Typically several execution units 8 are employed, forexample an arithmetic execution unit, a floating point execution unitand a branch instruction execution unit. The instruction is executed bythe execution unit, accessing operands from instruction specifiedregisters or memory as needed. If an operand is to be accessed (loadedor stored) from memory 2, a load store unit 5 typically handles theaccess under control of the instruction being executed. Instructions maybe executed in hardware circuits or in internal microcode (firmware) orby a combination of both.

In FIG. 1B, an example of a prior art emulated Host Computer system 21is provided that emulates a Host computer system 50 of a Hostarchitecture. In the emulated Host Computer system 21, the Hostprocessor (CPU) 1 is an emulated Host processor (or virtual Hostprocessor) and comprises an emulation processor 27 having a differentnative instruction set architecture than that of the processor 1 of theHost Computer 50. The emulated Host Computer system 21 has memory 22accessible to the emulation processor 27. In the example embodiment, theMemory 27 is partitioned into a Host Computer Memory 2 portion and anEmulation Routines 23 portion. The Host Computer Memory 2 is availableto programs of the emulated Host Computer 21 according to Host ComputerArchitecture. The emulation Processor 27 executes native instructions ofan architected instruction set of an architecture other than that of theemulated processor 1, the native instructions obtained from EmulationRoutines memory 23, and may access a Host instruction for execution froma program in Host Computer Memory 2 by employing one or moreinstruction(s) obtained in a Sequence & Access/Decode routine which maydecode the Host instruction(s) accessed to determine a nativeinstruction execution routine for emulating the function of the Hostinstruction accessed. Other facilities that are defined for the HostComputer System 50 architecture may be emulated by ArchitectedFacilities Routines, including such facilities as General PurposeRegisters, Control Registers, Dynamic Address Translation and I/OSubsystem support and processor cache for example. The EmulationRoutines may also take advantage of function available in the emulationProcessor 27 (such as general registers and dynamic translation ofvirtual addresses) to improve performance of the Emulation Routines.Special Hardware and Off-Load Engines may also be provided to assist theprocessor 27 in emulating the function of the Host Computer 50.

In a mainframe, architected machine instructions are used byprogrammers, usually today “C” programmers often by way of a compilerapplication. These instructions stored in the storage medium may beexecuted natively in a z/Architecture IBM Server, or alternatively inmachines executing other architectures. They can be emulated in theexisting and in future IBM mainframe servers and on other machines ofIBM (e.g. pSeries® Servers and xSeries® Servers). They can be executedin machines running Linux on a wide variety of machines using hardwaremanufactured by IBM®, Intel®, AMD®, Sun Microsystems and others. Besidesexecution on that hardware under a Z/Architecture®, Linux can be used aswell as machines which use emulation by Hercules, UMX, FSI (FundamentalSoftware, Inc) or Platform Solutions, Inc. (PSI), where generallyexecution is in an emulation mode. In emulation mode, emulation softwareis executed by a native processor to emulate the architecture of anemulated processor.

The native processor 27 typically executes emulation software 23comprising either firmware or a native operating system to performemulation of the emulated processor. The emulation software 23 isresponsible for fetching and executing instructions of the emulatedprocessor architecture. The emulation software 23 maintains an emulatedprogram counter to keep track of instruction boundaries. The emulationsoftware 23 may fetch one or more emulated machine instructions at atime and convert the one or more emulated machine instructions to acorresponding group of native machine instructions for execution by thenative processor 27. These converted instructions may be cached suchthat a faster conversion can be accomplished. Not withstanding, theemulation software must maintain the architecture rules of the emulatedprocessor architecture so as to assure operating systems andapplications written for the emulated processor operate correctly.Furthermore the emulation software must provide resources identified bythe emulated processor 1 architecture including, but not limited tocontrol registers, general purpose registers, floating point registers,dynamic address translation function including segment tables and pagetables for example, interrupt mechanisms, context switch mechanisms,Time of Day (TOD) clocks and architected interfaces to I/O subsystemssuch that an operating system or an application program designed to runon the emulated processor, can be run on the native processor having theemulation software.

A specific instruction being emulated is decoded, and a subroutinecalled to perform the function of the individual instruction. Anemulation software function 23 emulating a function of an emulatedprocessor 1 is implemented, for example, in a “C” subroutine or driver,or some other method of providing a driver for the specific hardware aswill be within the skill of those in the art after understanding thedescription of the preferred embodiment. Various software and hardwareemulation patents including, but not limited to U.S. Pat. No. 5,551,013for a “Multiprocessor for hardware emulation” of Beausoleil et al., andU.S. Pat. No. 6,009,261: Preprocessing of stored target routines foremulating incompatible instructions on a target processor” of Scalzi etal; and U.S. Pat. No. 5,574,873: Decoding guest instruction to directlyaccess emulation routines that emulate the guest instructions, ofDavidian et al; U.S. Pat. No. 6,308,255: Symmetrical multiprocessing busand chipset used for coprocessor support allowing non-native code to runin a system, of Gorishek et al; and U.S. Pat. No. 6,463,582: Dynamicoptimizing object code translator for architecture emulation and dynamicoptimizing object code translation method of Lethin et al; and U.S. Pat.No. 5,790,825: Method for emulating guest instructions on a hostcomputer through dynamic recompilation of host instructions of EricTraut; each of the above incorporated herein by reference in theirentirety. These references illustrate a variety of known ways to achieveemulation of an instruction format architected for a different machinefor a target machine available to those skilled in the art, as well asthose commercial software techniques used by those referenced above.

SUMMARY

In an embodiment selected installed functions of a multi-functioninstruction are hidden, the multi-function instruction architected toperform a function of a plurality of installed functions, the hidingcomprising setting a value controlling availability of installedfunctions to a multi-function instruction of a Host computer comprisingone or more processors, a processor having a first plurality of saidinstalled functions of the multi-function instruction, the firstplurality of installed functions comprising one or more first installedfunctions and one or more second installed functions, and executing amulti-function instruction, the multi-function instruction comprising anopcode field, the execution comprises responsive to the multi-functioninstruction for which a query function is specified, performing thequery function to determine installed functions available to themulti-function instruction; the query function execution using the valueto determine the one or more second installed functions; and the queryfunction execution storing a result value indicating one or more of theone or more second installed functions are not available to themulti-function instruction.

In an embodiment, the value is set by a hypervisor of the Host computerfor a virtual machine of the Host computer, the virtual machinecomprising one or more logical processors, the one or more logicalprocessors being assigned to one or more physical processors, a physicalprocessor having the one or more second installed functions of themulti-function instruction, wherein the multi-function instruction isexecuted in the virtual machine by a logical processor of one or morelogical processors on a physical processor of the one or more physicalprocessors.

In an embodiment, the one or more second installed functions isdetermined based on the opcode of the multi-function instruction.

In an embodiment, the hypervisor sets another value controllingavailability of installed functions to a multi-function instructionexecuting on another virtual machine of the Host computer system; andexecutes another multi-function instruction in the another virtualmachine by another logical processor of one or more another logicalprocessors; responsive to the another multi-function instructionspecifying another query function, the another query function isperformed to determine installed functions available to the anothermulti-function instruction; the another query function execution usesthe another value to determine one or more third installed functions;and the another query function execution stores another result valueindicating one or more of the one or more third installed functions arenot available to the another multi-function instruction.

In an embodiment, the stored result value is a bit significant value,where each bit position corresponds to a function, and a bit being 1indicates the corresponding function is installed.

In an embodiment, the query function is specified by a multi-functioninstruction specified function code or a multi-function instructionspecified test bit.

In an embodiment, the multi-function instruction is a zArchitectureinstruction consisting of any one of a cryptographic instruction, aPerform Timing Facility Function (PTFF) instruction, Perform FloatingPoint Operation instruction or a Perform Locked Operation instruction,wherein the cryptographic instruction comprises any one of a CipherMessage instruction, a Compute Intermediate Message instruction, aCompute Last Message Digest instruction, a Compute Last Message Digestinstruction, a Compute Message Authentication Code instruction, whereinthe multi-function instruction specifies a query function; responsive tothe multi-function instruction being a cryptographic instruction or aPTFF instruction, the multi-function instruction specified function codeto be executed is obtained, the obtained function code consisting of aquery function, wherein the stored result value is a plurality of bits,each bit of the plurality of bits indicating whether a correspondingfunction code is supported; and responsive to the multi-functioninstruction being a cryptographic instruction or a PTFF instruction, themulti-function instruction specified function code to be executed isobtained, the obtained function code not being the query function, acryptographic function or a PTFF function is performed according to theobtained function code; and responsive to the multi-function instructionbeing the Perform Locked Operation instruction or the Perform FloatingPoint Operation instruction and the multi-function instruction specifiedtest bit being 1, a determination is made whether a multi-functioninstruction specified function code is installed, wherein the storedresult value is a condition code value; and responsive to themulti-function instruction being the Perform Locked Operationinstruction or the Perform Floating Point Operation instruction and themulti-function instruction specified test bit being 0, a Floating Pointfunction or a locked operation is performed according to the obtainedfunction code.

The above as well as additional objectives, features, and advantageswill become apparent in the following written description.

Other embodiments and aspects are described in detail herein and areconsidered a part of the claimed invention. For a better understandingof advantages and features, refer to the description and to thedrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The subject matter which is regarded as the invention is particularlypointed out and distinctly claimed in the claims at the conclusion ofthe specification. The foregoing and other objects, features, andadvantages are apparent from the following detailed description taken inconjunction with the accompanying drawings in which:

FIG. 1A is a diagram depicting an example Host computer system;

FIG. 1B is a diagram depicting an example emulation Host computersystem;

FIG. 1C is a diagram depicting an example computer system;

FIG. 2 is a diagram depicting an example computer network;

FIG. 3 is a diagram depicting example elements of a computer system;

FIG. 4A is a diagram depicting an example execution unit;

FIG. 4B is a diagram depicting an example branch unit;

FIG. 4C is a diagram depicting an example Load/Store unit;

FIG. 5 is a diagram depicting an example logical portioning;

FIG. 6 is a diagram depicting example logical partitioning elements;

FIG. 7 is a diagram depicting example logical partitioning elements;

FIG. 8 is a flow depicting an example Opcode Table;

FIG. 9 is a flow depicting an example blocking technique;

FIG. 10 is a flow depicting an example blocking technique;

FIG. 11 is a flow depicting an example blocking technique; and

FIGS. 12-17 depict a flow of a function query blocking techniques.

DESCRIPTION

Embodiments may be practiced by software (sometimes referred to LicensedInternal Code, Firmware, Micro-code, Milli-code, Pico-code and the like,any of which would be consistent with the teaching herein). Referring toFIG. 1A, a software program code embodiment is typically accessed by theprocessor also known as a CPU (Central Processing Unit) 1 of the system50 from long-term storage media 11, such as a CD-ROM drive, tape driveor hard drive. The software program code may be embodied on any of avariety of known media for use with a data processing system, such as adiskette, hard drive, or CD-ROM. The code may be distributed on suchmedia, or may be distributed to users from the computer memory 2 orstorage of one computer system over a network 10 to other computersystems for use by users of such other systems.

Alternatively, the program code may be embodied in the memory 2, andaccessed by the processor 1 using the processor bus. Such program codeincludes an operating system which controls the function and interactionof the various computer components and one or more application programs.Program code is normally paged from dense storage media 11 to high-speedmemory 2 where it is available for processing by the processor 1. Thetechniques and methods for embodying software program code in memory, onphysical media, and/or distributing software code via networks are wellknown and will not be further discussed herein. Program code, whencreated and stored on a tangible medium (including but not limited toelectronic memory modules (RAM), flash memory, Compact Discs (CDs),DVDs, Magnetic Tape and the like is often referred to as a “computerprogram product”. The computer program product medium is typicallyreadable by a processing circuit preferably in a computer system forexecution by the processing circuit.

FIG. 1C illustrates a representative workstation or server hardwaresystem in which embodiments may be practiced. The system 100 of FIG. 1Ccomprises a representative computer system 101, such as a personalcomputer, a workstation or a server, including optional peripheraldevices. The workstation 101 includes one or more processors 106 and abus employed to connect and enable communication between theprocessor(s) 106 and the other components of the system 101 inaccordance with known techniques. The bus connects the processor 106 tomemory 105 and long-term storage 107 which can include a hard drive(including any of magnetic media, CD, DVD and Flash Memory for example)or a tape drive for example. The system 101 might also include a userinterface adapter, which connects the microprocessor 106 via the bus toone or more interface devices, such as a keyboard 104, mouse 103, aPrinter/scanner 110 and/or other interface devices, which can be anyuser interface device, such as a touch sensitive screen, digitized entrypad, etc. The bus also connects a display device 102, such as an LCDscreen or monitor, to the microprocessor 106 via a display adapter.

The system 101 may communicate with other computers or networks ofcomputers by way of a network adapter capable of communicating 108 witha network 109. Example network adapters are communications channels,token ring, Ethernet or modems. Alternatively, the workstation 101 maycommunicate using a wireless interface, such as a CDPD (cellular digitalpacket data) card. The workstation 101 may be associated with such othercomputers in a Local Area Network (LAN) or a Wide Area Network (WAN), orthe workstation 101 can be a client in a client/server arrangement withanother computer, etc. All of these configurations, as well as theappropriate communications hardware and software, are known in the art.

FIG. 2 illustrates a data processing network 200 in which an embodimentmay be practiced. The data processing network 200 may include aplurality of individual networks, such as a wireless network and a wirednetwork, each of which may include a plurality of individualworkstations 101 201 202 203 204. Additionally, as those skilled in theart will appreciate, one or more LANs may be included, where a LAN maycomprise a plurality of intelligent workstations coupled to a hostprocessor.

Still referring to FIG. 2, the networks may also include mainframecomputers or servers, such as a gateway computer (client server 206) orapplication server (remote server 208 which may access a data repositoryand may also be accessed directly from a workstation 205). A gatewaycomputer 206 serves as a point of entry into each network 207. A gatewayis needed when connecting one networking protocol to another. Thegateway 206 may be preferably coupled to another network (the Internet207 for example) by means of a communications link. The gateway 206 mayalso be directly coupled to one or more workstations 101 201 202 203 204using a communications link. The gateway computer may be implementedutilizing an IBM eServer™ zSeries® z9® Server available from IBM Corp.

Software programming code is typically accessed by the processor 106 ofthe system 101 from long-term storage media 107, such as a CD-ROM driveor hard drive. The software programming code may be embodied on any of avariety, of known media for use with a data processing system, such as adiskette, hard drive, or CD-ROM. The code may be distributed on suchmedia, or may be distributed to users 210 211 from the memory or storageof one computer system over a network to other computer systems for useby users of such other systems.

Alternatively, the programming code 111 may be embodied in the memory105, and accessed by the processor 106 using the processor bus. Suchprogramming code includes an operating system which controls thefunction and interaction of the various computer components and one ormore application programs 112. Program code is normally paged from densestorage media 107 to high-speed memory 105 where it is available forprocessing by the processor 106. The techniques and methods forembodying software programming code in memory, on physical media, and/ordistributing software code via networks are well known and will not befurther discussed herein. Program code, when created and stored on atangible medium (including but not limited to electronic memory modules(RAM), flash memory, Compact Discs (CDs), DVDs, Magnetic Tape and thelike is often referred to as a “computer program product”. The computerprogram product medium is typically readable by a processing circuitpreferably in a computer system for execution by the processing circuit.

The cache that is most readily available to the processor (normallyfaster and smaller than other caches of the processor) is the lowest (L1or level one) cache and main store (main memory) is the highest levelcache (L3 if there are 3 levels). The lowest level cache is oftendivided into an instruction cache (I-Cache) holding machine instructionsto be executed and a data cache (D-Cache) holding data operands.

Referring to FIG. 3, an exemplary processor embodiment is depicted forprocessor 106. Typically one or more levels of Cache 303 are employed tobuffer memory blocks in order to improve processor performance. Thecache 303 is a high speed buffer holding cache lines of memory data thatare likely to be used. Typical cache lines are 64, 128 or 256 bytes ofmemory data. Separate Caches are often employed for caching instructionsthan for caching data. Cache coherence (synchronization of copies oflines in Memory and the Caches) is often provided by various “Snoop”algorithms well known in the art. Main storage 105 of a processor systemis often referred to as a cache. In a processor system having 4 levelsof cache 303 main storage 105 is sometimes referred to as the level 5(L5) cache since it is typically faster and only holds a portion of thenon-volatile storage (DASD, Tape etc) that is available to a computersystem. Main storage 105 “caches” pages of data paged in and out of themain storage 105 by the Operating system.

A program counter (instruction counter) 311 keeps track of the addressof the current instruction to be executed. A program counter in az/Architecture processor is 64 bits and can be truncated to 31 or 24bits to support prior addressing limits. A program counter is typicallyembodied in a PSW (program status word) of a computer such that itpersists during context switching. Thus, a program in progress, having aprogram counter value, may be interrupted by, for example, the operatingsystem (context switch from the program environment to the Operatingsystem environment). The PSW of the program maintains the programcounter value while the program is not active, and the program counter(in the PSW) of the operating system is used while the operating systemis executing. Typically the Program counter is incremented by an amountequal to the number of bytes of the current instruction. RISC (ReducedInstruction Set Computing) instructions are typically fixed length whileCISC (Complex Instruction Set Computing) instructions are typicallyvariable length. Instructions of the IBM z/Architecture are CISCinstructions having a length of 2, 4 or 6 bytes. The Program counter 311is modified by either a context switch operation or a Branch takenoperation of a Branch instruction for example. In a context switchoperation, the current program counter value is saved in a ProgramStatus Word (PSW) along with other state information about the programbeing executed (such as condition codes), and a new program countervalue is loaded pointing to an instruction of a new program module to beexecuted. A branch taken operation is performed in order to permit theprogram to make decisions or loop within the program by loading theresult of the Branch Instruction into the Program Counter 311.

Typically an instruction Fetch Unit 305 is employed to fetchinstructions on behalf of the processor 106. The fetch unit eitherfetches “next sequential instructions”, target instructions of BranchTaken instructions, or first instructions of a program following acontext switch. Modem Instruction fetch units often employ prefetchtechniques to speculatively prefetch instructions based on thelikelihood that the prefetched instructions might be used. For example,a fetch unit may fetch 16 bytes of instruction that includes the nextsequential instruction and additional bytes of further sequentialinstructions.

The fetched instructions are then executed by the processor 106. In anembodiment, the fetched instruction(s) are passed to a dispatch unit 306of the fetch unit. The dispatch unit decodes the instruction(s) andforwards information about the decoded instruction(s) to appropriateunits 307 308 310. An execution unit 307 will typically receiveinformation about decoded arithmetic instructions from the instructionfetch unit 305 and will perform arithmetic operations on operandsaccording to the opcode of the instruction. Operands are provided to theexecution unit 307 preferably either from memory 105, architectedregisters 309 or from an immediate field of the instruction beingexecuted. Results of the execution, when stored, are stored either inmemory 105, registers 309 or in other machine hardware (such as controlregisters, PSW registers and the like).

Referring to FIG. 5, an example Virtual Machine (VM) environment isshown. A Hypervisor program (which may itself be an Operating System(OS) such as zVM from IBM), running on multi-processor “Hardware”comprising a plurality of physical processors, a physical main memoryand physical adapters for communicating with I/O peripheral devicesincluding storage, networks, displays and the like. The Hypervisorcreates VM images (VM1, VM2 and VM3 for example) such that softwareincluding an OS and Application Programs can run within the virtualmachine utilizing virtual resources. The software running in a VM isunaware that it is running in a VM, and operates using the virtualresources as if they were physical resources. The zVM operating systemfrom IBM can create “Guest” images, each guest image is effectively avirtual machine. Furthermore, any zVM guest may itself run a zVM OScreating “second level Guests”. Thus, a virtual machine (guest image)could be nested in a hierarchy of virtual machines, each zVM playing ahypervisor role for its Guest images. On the other hand, amulti-processor platform may be “physically partitioned”, each physicalpartition may be assigned resources (processors, memory, I/O). Eachphysical partition is a VM since the software running in the partition,is not aware of resources of the machine not assigned to the partition.Thus the resources of the machine are “virtualized”. In anotherembodiment, a host machine may support logical partitions, each logicalpartition is a VM.

Virtualization is depicted for example in a white paper from VMware®titled “Virtualization Overview” and “VMware VMotion and CPUCompatibility” VMware® Infrastructure 3 from VMware® incorporated hereinby reference. Furthermore US Patent Application Publication No.2009/0070760 “VIRTUAL MACHINE (VM) MIGRATION BETWEEN PROCESSORARCHITECTURES” by Khatri et al. filed Sep. 6, 2007 and incorporatedherein by reference discusses emulating certain feature set to enable aVM migration amongst similar pools of machines by masking selected bitsof a CPUID register.

Referring to FIG. 6, each VM may have a different OS and differentapplications. For example, OS1 may be z/OS from IBM and OS2 may bezLinux from IBM, or all OS's may be the same OS's such as z/OS's.

The Hypervisor creates Logical Features, resources and capabilities foreach VM based on physical features, resources and capabilities. In anexample system, Physical Memory portions are allotted to each VM by wayof Dynamic Address Translation, physical processors are time-sharedamongst VMs as is I/O capability.

Referring to FIG. 7, each logical processor has access to physicalfeature registers by way of a Hypervisor managed Logical Feature Mask.Thus, software running on logical processors can give the appearance ofoperating on a common processor Architecture level, even if the actualprocessors are at different Architecture levels. In an example, thePhysical Feature register might be an Intel CPUID register thatindicates the architecture level of the Intel processor as well asspecific features that are available to the programmer. The Logicalfeature mask is programmed to provide all or a subset of the physicalprocessors CPUID to the software in a Virtual Machine (VM) when the VMqueries the CPUID of the corresponding Logical processor.

The x86 processor architecture from Intel®, “Intel® Itanium®Architecture Software Developer's Manual, Volume 2, Revision 2.2 Jan.2006” incorporated by references, provides CPUID registers to identifyfeatures supported by a processor. The CPUID registers are unprivilegedand accessed using the indirect move (from) instruction. All registersbeyond register CPUID number are reserved and raise a ReservedRegister/Field fault if they are accessed. Writes are not permitted andno instruction exists for such an operation. Vendor information islocated in CPUID registers 0 and 1 and specify a vendor name, in ASCII,for the processor implementation. All bytes after the end of the stringup to the 16th byte are zero. Earlier ASCII characters are placed inlower number register and lower numbered byte positions. CPUID register4 provides general application-level information about processorfeatures. It contains a set of flag bits used to indicate if a givenfeature is supported in the processor model. When a bit is one thefeature is supported; when 0 the feature is not supported. As newfeatures are added (or removed) from future processor models thepresence (or removal) of new features will be indicated by new featurebits. CPUID register 4 is logically split into two halves, both of whichcontain general feature and capability information but which havedifferent usage models and access capabilities; this informationreflects the status of any enabled or disabled features. Both the upperand lower halves of CPUID register 4 are accessible through the moveindirect register instruction; depending on the implementation, thelatency for this access can be long and this access method is notappropriate for low-latency code versioning using self-selection. Inaddition, the upper half of CPUID register 4 is also accessible usingthe test feature instruction; the latency for this access is comparableto that of the test bit instruction and this access method enableslow-latency code versioning using self selection.

The z/Architecture Principles of Operation provides a Store FacilityList Extended (STFLE) instruction that like the Intel CPUID registerprovides the software with the knowledge of the features (orarchitecture levels) of the underlying Central Processing Units (CPU's)or processors. The STFLE instruction has the format shown in Table 1below.

TABLE 1

The STFLE instruction (TABLE 1) comprises an Opcode field bits (0-15), aregister field B2 (16-19) and a displacement (immediate) field D2(20-31). The execution of the STFLE instruction by a machine, stores alist of bits providing information about facilities in a program memorylocation determined by adding the contents of the register specified bythe B2 field of the instruction to the 12 bit D2 immediate field, thememory location beginning at the doubleword (8 bytes, a word is 4 bytes)specified by the second operand address ((B2)+D2). The address of theprogram memory location in the zArchitecture is subject to DynamicAddress Translation (DAT).

Reserved bits are bits that are not currently assigned to represent afacility. For the leftmost doublewords in which facility bits areassigned, the reserved bits are stored as zeros. Doublewords to theright of the doubleword in which the highest-numbered facility bit isassigned for a model may or may not be stored. Access exceptions and PERevents are not recognized for doublewords that are not stored. The sizeof the second operand, in doublewords, is one more than the valuespecified in bits 56-63 of general register 0. The remaining bits ofgeneral register 0 are unassigned and should contain zeros; otherwise,the program may not operate compatibly in the future.

When the size of the second operand is large enough to contain all ofthe facility bits assigned for a model, then the complete facility listis stored in the second operand location, bits 56-63 of general register0 are updated to contain one less than the number of doublewords neededto contain all of the facility bits assigned for the model, andcondition code 0 is set.

When the size of the second operand is not large enough to contain allof the facility bits assigned for a model, then only the number ofdoublewords specified by the second-operand size are stored, bits 56-63of general register 0 are updated to contain one less than the number ofdoublewords needed to contain all of the facility bits assigned for themodel, and condition code 3 is set.

Execution of the instruction results in setting of a Condition Codevalue, the Condition Code value is saved during context switching withthe Program Status Word (PSW).

Special Conditions

The second operand must be designated on a doubleword boundary;otherwise, a specification exception is recognized.

Resulting Condition Code:

0 Complete facility list stored1—2—3 Incomplete facility list stored

Program Exceptions:

Access (store, second operand)Operation (if the store-facility-list-extended facility is notinstalled)

Specification

Programming Notes:

1. The performance of STORE FACILITY LIST EXTENDED may be significantlyslower than that of simply testing a byte in storage. Programs that needto frequently test for the presence of a facility—for example, dual-pathcode in which the facility is used in one path but not another—shouldexecute the STORE FACILITY LIST EXTENDED instruction once duringinitialization. Subsequently, the program may test for the presence ofthe facility by examining the stored result, using an instruction suchas TEST UNDER MASK.2. When condition code 0 is set, bits 56-63 of general register 0 areupdated to indicate the number of doublewords stored. If the programchooses to ignore the results in general register 0, then it shouldensure that the entire second operand in storage is set to zero prior toexecuting STORE FACILITY LIST EXTENDED.

TABLE 2 shows prior art z/Architecture assigned STFLE bits and theirmeaning. A bit is set to one regardless of the current architecturalmode if its meaning is true. A meaning applies to the currentarchitectural mode unless it is said to apply to a specificarchitectural mode.

Unassigned bits are reserved for indication of new facilities; thesebits may be stored as ones in the future.

The prior art z/Architecture facility list is defined as shown in Table2 below:

TABLE 2 Bit Meaning-When-Bit-Is-One: 0 The instructions marked “N3” inthe instruction summary figures in Chapters 7 and 10 of z/Architectureare installed. 1 The z/Architecture architectural mode is installed. 2The z/Architecture architectural mode is active. When this bit is zero,the ESA/390 architectural mode is active. 3 The DAT-enhancement facilityis installed in the z/Architecture architectural mode. The DATenhancement facility includes the INVALIDATE DAT TABLE ENTRY (IDTE) andCOMPARE AND SWAP AND PURGE (CSPG) instructions. 4 INVALIDATE DAT TABLEENTRY (IDTE) performs the invalidation-and-clearing operation byselectively clearing combined region-and-segment table entries when asegment-table entry or entries are invalidated. IDTE also performs theclearing-by- ASCE operation. Unless bit 4 is one, IDTE simply purges allTLBs. Bit 3 is one if bit 4 is one. 5 INVALIDATE DAT TABLE ENTRY (IDTE)performs the invalidation-and-clearing operation by selectively clearingcombined region-and-segment table entries when a region-table entry orentries are invalidated. Bits 3 and 4 are ones if bit 5 is one. 6 TheASN-and-LX reuse facility is installed in the z/Architecturearchitectural mode. 7 The store-facility-list-extended facility isinstalled. 8 The enhanced-DAT facility is installed in thez/Architecture architectural mode. 9 The sense-running-status facilityis installed in the z/Architecture architectural mode. 10 Theconditional-SSKE facility is installed in the z/Architecturearchitectural mode. 11 The configuration-topology facility is installedin the z/Architecture architectural mode. 16 The extended-translationfacility 2 is installed. 17 The message-security assist is installed. 18The long-displacement facility is installed in the z/Architecturearchitectural mode. 19 The long-displacement facility has highperformance. Bit 18 is one if bit 19 is one. 20 TheHFP-multiply-and-add/subtract facility is installed. 21 Theextended-immediate facility is installed in the z/Architecturearchitectural mode. 22 The extended-translation facility 3 is installedin the z/Architecture architectural mode. 23 TheHFP-unnormalized-extension facility is installed in the z/Architecturearchitectural mode. 24 The ETF2-enhancement facility is installed. 25The store-clock-fast facility is installed in the z/Architecturearchitectural mode. 26 The parsing-enhancement facility is installed inthe z/Architecture architectural mode. 27 Themove-with-optional-specifications facility is installed in thez/Architecture architectural mode. 28 The TOD-clock-steering facility isinstalled in the z/Architecture architectural mode. 30 TheETF3-enhancement facility is installed in the z/Architecturearchitectural mode. 31 The extract-CPU-time facility is installed in thez/Architecture architectural mode. 32 The compare-and-swap-and-storefacility is installed in the z/Architecture architectural mode. 33 Thecompare-and-swap-and-store facility 2 is installed in the z/Architecturearchitectural mode. 34 The general-instructions-extension facility isinstalled in the z/Architecture architectural mode. 35 Theexecute-extensions facility is installed in the z/Architecturearchitectural mode. 39 Assigned to IBM internal use. 41 Thefloating-point-support-enhancement facilities (FPR-GR-transfer,FPS-sign-handling, and DFP rounding) are installed in the z/Architecturearchitectural mode. 42 The DFP (decimal-floating-point) facility isinstalled in the z/Architecture architectural mode. 43 The DFP(decimal-floating-point) facility has high performance. Bit 42 is one ifbit 43 is one. 44 The PFPO instruction is installed in thez/Architecture architectural mode.

An instruction may perform a single function in an architecture or, insome cases, any of a plurality of selectable functions. The selectablefunctions defined for an instruction may be different from machine tomachine. For example, a multi-function instruction, when introduced forthe first time in an architected instruction set, may have only a fewselectable functions. A later architected instruction set may introducemore selectable functions to the previously introduced multi-functioninstruction. In an embodiment, a VM can be assigned a subset of thephysical processor's selectable function whereby an instruction, runningon a logical processor of the VM may query a list of available functionsof the logical processor and only the functions assigned to the VM arereturned, even though the physical processor can perform more selectablefunctions. In one embodiment, this is accomplished through aFunction-Indicating-Instruction Interception Facility (FIIIF) thatenables a hypervisor to trap, or intercept, execution of this queryfunction by a guest (virtual machine), in order to present the reducedlist of available functions. In another embodiment, the hypervisorspecifies, for example through a bit mask, the set of functions to bereported to the guest, and the query function of the multi-functioninstruction reports this list. Furthermore, in an embodiment aninstruction, executing on the logical processor, will experience aprogram exception if it attempts to perform a selected selectablefunction.

In the case of a multi-function instruction capable of querying theexistence of installed functions and also of executing a selected one ofthe installed functions, the execution of the installed functionsincluding the query function may be performed in hardware (includingcircuit and microcode for example) in order to achieve the bestperformance. In an embodiment, when the FIIIF feature is installed, thequery function is intercepted by software for execution rather thanhardware. Thus, only execution of the query function will encounteradditional delay to determine which installed features to report. In anembodiment, the interception is to the Hypervisor code that performs thequery function and returns appropriate results on behalf of the virtualmachine.

An example of an instruction having selectable functions, is CIPHERMESSAGE instruction of the z/Architecture.

The CIPHER MESSAGE (KM) instruction can perform any of a plurality of aplurality of cipher message functions. One of the functions provided byCIPHER MESSAGE is to query the processor for a bit significant list ofcipher message functions supported by the processor.

The format of the CIPHER MESSAGE instruction (TABLE 3) is as follows,where R1 designates a first General Register, and R2 designate a secondGeneral Register.

TABLE 3

The execution of the CIPHER MESSAGE instruction (TABLE 3) is as follows.

A function specified by the function code in implied general register 0is performed.

Bits 16-23 of the instruction are ignored.

Bit positions 57-63 of general register 0 contain the function code.

The currently assigned function codes for CIPHER MESSAGE and CIPHERMESSAGE WITH CHAINING, respectively (0-3 and 18-20) are shown in theTABLE 4. All other function codes are unassigned. For cipher functions,bit 56 is the modifier bit which specifies whether an encryption or adecryption operation is to be performed. The modifier bit is ignored forall other functions. All other bits of general register 0 are ignored.

Implied general register 1 contains the logical address of the leftmostbyte of the parameter block in storage. In the 24-bit addressing mode,the contents of bit positions 40-63 of general register 1 constitute theaddress, and the contents of bit positions 0-39 are ignored. In the31-bit addressing mode, the contents of bit positions 33-63 of generalregister 1 constitute the address, and the contents of bit positions0-32 are ignored. In the 64-bit addressing mode, the contents of bitpositions 0-63 of general register 1 constitute the address.

The query function provides the means of indicating the availability ofthe other functions. The contents of general registers specified byfields of the instruction (R1, R2), and R2+1 are ignored for the queryfunction.

For all other functions, the second operand (specified by R2) isciphered as specified by the function code using a cryptographic key inthe parameter block, and the result is placed in the first-operandlocation.

For CIPHER MESSAGE WITH CHAINING, ciphering also uses an initialchaining value in the parameter block, and the chaining value is updatedas part of the operation. Register use for 24 bit addressing is shown inTABLE 5.

The R1 field designates a general register and must designate aneven-numbered register; otherwise, a specification exception isrecognized.

The R2 field designates an even-odd pair of general registers and mustdesignate an even-numbered register; otherwise, a specificationexception is recognized.

The location of the leftmost byte of the first and second operands isspecified by the contents of the R1 and R2 general registers,respectively. The number of bytes in the second-operand location isspecified in general register R2+1. The first operand is the same lengthas the second operand.

As part of the operation, the addresses in general registers R1 and R2are incremented by the number of bytes processed, and the length ingeneral register R2+1 is decremented by the same number. The formationand updating of the addresses and length is dependent on the addressingmode.

In the 24-bit addressing mode, the contents of bit positions 40-63 ofgeneral registers R1 and R2 constitute the addresses of the first andsecond operands, respectively, and the contents of bit positions 0-39are ignored; bits 40-63 of the updated addresses replace thecorresponding bits in general registers R1 and R2, carries out of bitposition 40 of the updated address are ignored, and the contents of bitpositions 32-39 of general registers R1 and R2 are set to zeros. In the31-bit addressing mode, the contents of bit positions 33-63 of generalregisters R1 and R2 constitute the addresses of the first and secondoperands, respectively, and the contents of bit positions 0-32 areignored; bits 33-63 of the updated addresses replace the correspondingbits in general registers R1 and R2, carries out of bit position 33 ofthe updated address are ignored, and the content of bit position 32 ofgeneral registers R1 and R2 is set to zero. In the 64-bit addressingmode, the contents of bit positions 0-63 of general registers R1 and R2constitute the addresses of the first and second operands, respectively;bits 0-63 of the updated addresses replace the contents of generalregisters R1 and R2, and carries out of bit position 0 are ignored.

In both the 24-bit and the 31-bit addressing modes, the contents of bitpositions 32-63 of general register R2+1 form a 32-bit unsigned binaryinteger which specifies the number of bytes in the first and secondoperands, and the contents of bit positions 0-31 are ignored; bits 32-63of the updated value replace the corresponding bits in general registerR2+1. In the 64-bit addressing mode, the contents of bit positions 0-63of general register R2+1 form a 64-bit unsigned binary integer whichspecifies the number of bytes in the first and second operands; and theupdated value replaces the contents of general register R2+1.

In the 24-bit or 31-bit addressing mode, the contents of bit positions0-31 of general registers R1, R2, and R2+1, always remain unchanged. Thefigure below depicts the contents of the general registers justdescribed.

In the access-register mode, access registers 1, R1, and R2 specify theaddress spaces containing the parameter block, first, and secondoperands, respectively.

The result is obtained as if processing starts at the left end of boththe first and second operands and proceeds to the right, block by block.The operation is ended when the number of bytes in the second operand asspecified in general register R2+1 have been processed and placed at thefirst-operand location (called normal completion) or when aCPU-determined number of blocks that is less than the length of thesecond operand have been processed (called partial completion). TheCPU-determined number of blocks depends on the model, and may be adifferent number each time the instruction is executed. TheCPU-determined number of blocks is usually nonzero. In certain unusualsituations, this number may be zero, and condition code 3 may be setwith no progress. However, the CPU protects against endless reoccurrenceof this no-progress case.

The results in the first-operand location and the chaining-value fieldare unpredictable if any of the following situations occur:

The cryptographic-key field overlaps any portion of the first operand.

The chaining-value field overlaps any portion of the first operand orthe second operand.

The first and second operands overlap destructively. Operands are saidto overlap destructively when the first-operand location would be usedas a source after data would have been moved into it, assumingprocessing to be performed from left to right and one byte at a time.

When the operation ends due to normal completion, condition code 0 isset and the resulting value in R2+1 is zero. When the operation ends dueto partial completion, condition code 3 is set and the resulting valuein R2+1 is nonzero.

When a storage-alteration PER event is recognized, fewer than 4Kadditional bytes are stored into the first-operand locations before theevent is reported.

When the second-operand length is initially zero, the parameter block,first, and second operands are not accessed, general registers R1, R2,and R2+1 are not changed, and condition code 0 is set.

When the contents of the R1 and R2 fields are the same, the contents ofthe designated registers are incremented only by the number of bytesprocessed, not by twice the number of bytes processed.

As observed by other CPUs and channel programs, references to theparameter block and storage operands may be multiple-access references,accesses to these storage locations are not necessarilyblock-concurrent, and the sequence of these accesses or references isundefined.

In certain unusual situations, instruction execution may complete bysetting condition code 3 without updating the registers and chainingvalue to reflect the last unit of the first and second operandsprocessed. The size of the unit processed in this case depends on thesituation and the model, but is limited such that the portion of thefirst and second operands which have been processed and not reported donot overlap in storage. In all cases, change bits are set and PERstorage-alteration events are reported, when applicable, for allfirst-operand locations processed.

Access exceptions may be reported for a larger portion of an operandthan is processed in a single execution of the instruction; however,access exceptions are not recognized for locations beyond the length ofan operand nor for locations more than 4K bytes beyond the currentlocation being processed.

-   -   The function codes for CIPHER MESSAGE are as follows.

TABLE 4 Parm. Block Data Block Code Function Size (bytes) Size (bytes) 0KM-Query 16 — 1 KM-DEA 8 8 2 KM-TDEA-128 16 8 3 KM-TDEA-192 24 8 18KM-AES-128 16 16 19 KM-AES-192 24 16 20 KM-AES-256 32 16 Explanation: —Not applicable

TABLE 5 All Addressing Modes

24 bit Addressing Mode

Using the CIPHER MESSAGE instruction as an example, an example machinemay implement CIPHER MESSAGE functions. In the example implementation,Host processors may implement all of the functions shown (function code0-3 and 18-20). A host Operating System (OS) (or hypervisor) may createone or more virtual machines for Guest OSs. One Virtual machine might bedefined for a previous level architecture, not having CIPHER MESSAGEinstructions.

According to an embodiment, if an Instruction Blocking Facility wereinstalled and CIPHER MESSAGE instructions were designated as Blockedinstructions for a VM, the Virtual machine would not permit CIPHERMESSAGE instruction execution by programs running in the Virtualmachine, even though the underlying Host machine supported CIPHERMESSAGE instructions. an attempt to execute a CIPHER MESSAGE instructionin the VM would result in a program check (program exception).

According to another embodiment, if a Function blocking facility wereinstalled and only a subset of the CIPHER MESSAGE functions (FunctionCodes 0-3 for example) were permitted in a VM, the Virtual machine wouldpermit CIPHER MESSAGE execution but would not permit CIPHER MESSAGEinstruction execution of CIPHER MESSAGE instructions having a functioncode other than 0-3 by programs running in the Virtual machine, eventhough the underlying Host machine supported CIPHER MESSAGE instructionssupporting the function codes (0-3 and 18-20). an attempt to execute aCIPHER MESSAGE instruction having function codes other than 0-3 such asany of 18-20) would result in a program check (program exception).

In another embodiment, if a Function test/query facility were installedand only a subset of the CIPHER MESSAGE functions (Function Codes 0-3for example) were permitted in a VM, execution of a CIPHER MESSAGE queryof the CIPHER MESSAGE functions would return only function codes 0-3,even though the underlying Host machine supported function codes 0-3 and18-20.

Other Example zArchitecture Multi-Function Instructions:

Compute Intermediate Message Digest (KIMD) and Compute Last MessageDigest (KLMD) Instructions:

When executed by a computer system, a function specified by the functioncode in general register 0 is performed. Bits 16-23 of the instructionand the R1 field are ignored. Bit positions 57-63 of general register 0contain the function code. Bit 56 of general register 0 must be zero;otherwise, a specification exception is recognized. All other bits ofgeneral register 0 are ignored. General register 1 contains the logicaladdress of the leftmost byte of the parameter block in storage. In the24-bit addressing mode, the contents of bit positions 40-63 of generalregister 1 constitute the address, and the contents of bit positions0-39 are ignored. In the 31-bit addressing mode, the contents of bitpositions 33-63 of general register 1 constitute the address, and thecontents of bit positions 0-32 are ignored. In the 64-bit addressingmode, the contents of bit positions 0-63 of general register 1constitute the address. All other function codes are unassigned. Thequery function provides the means of indicating the availability of theother functions. The contents of general registers R2 and R2+1 areignored for the query function. For all other functions, the secondoperand is processed as specified by the function code using an initialchaining value in the parameter block, and the result replaces thechaining value. For COMPUTE LAST MESSAGE DIGEST, the operation also usesa message bit length in the parameter block. The operation proceedsuntil the end of the second-operand location is reached or aCPU-determined number of bytes have been processed, whichever occursfirst. The result is indicated in the condition code. The R2 fielddesignates an even-odd pair of general registers and must designate aneven-numbered register; otherwise, a specification exception isrecognized. The location of the leftmost byte of the second operand isspecified by the contents of the R2 general register. The number ofbytes in the second-operand location is specified in general registerR2+1. As part of the operation, the address in general register R2 isincremented by the number of bytes processed from the second operand,and the length in general register R2+1 is decremented by the samenumber. The formation and updating of the address and length isdependent on the addressing mode. In the 24-bit addressing mode, thecontents of bit positions 40-63 of general register R2 constitute theaddress of second operand, and the contents of bit positions 0-39 areignored; bits 40-63 of the updated address replace the correspondingbits in general register R2, carries out of bit position 40 of theupdated address are ignored, and the contents of bit positions 32-39 ofgeneral register R2 are set to zeros. In the 31-bit addressing mode, thecontents of bit positions 33-63 of general register R2 constitute theaddress of second operand, and the contents of bit positions 0-32 areignored; bits 33-63 of the updated address replace the correspondingbits in general register R2, carries out of bit position 33 of theupdated address are ignored, and the content of bit position 32 ofgeneral register R2 is set to zero. In the 64-bit addressing mode, thecontents of bit positions 0-63 of general register R2 constitute theaddress of second operand; bits 0-63 of the updated address replace thecontents of general register R2 and carries out of bit position 0 areignored. In both the 24-bit and the 31-bit addressing modes, thecontents of bit positions 32-63 of general register R2+1 form a 32-bitunsigned binary integer which specifies the number of bytes in thesecond operand; and the updated value replaces the contents of bitpositions 32-63 of general register R2+1. In the 64-bit addressing mode,the contents of bit positions 0-63 of general register R2+1 form a64-bit unsigned binary integer which specifies the number of bytes inthe second operand; and the updated value replaces the contents ofgeneral register R2+1. In the 24-bit or 31-bit addressing mode, thecontents of bit positions 0-31 of general registers R2 and R2+1, alwaysremain unchanged In the access-register mode, access registers 1 and R2specify the address spaces containing the parameter block and secondoperand, respectively. The result is obtained as if processing starts atthe left end of the second operand and proceeds to the right, block byblock. The operation is ended when all source bytes in the secondoperand have been processed (called normal completion), or when a CPUdetermined number of blocks that is less than the length of the secondoperand have been processed (called partial completion). TheCPU-determined number of blocks depends on the model, and may be adifferent number each time the instruction is executed. TheCPU-determined number of blocks is usually nonzero. In certain unusualsituations, this number may be zero, and condition code 3 may be setwith no progress. However, the CPU protects against endless reoccurrenceof this no-progress case. When the chaining-value field overlaps anyportion of the second operand, the result in the chaining-value field isunpredictable. For COMPUTE INTERMEDIATE MESSAGE DIGEST, normalcompletion occurs when the number of bytes in the second operand asspecified in general register R2+1 have been processed. For COMPUTE LASTMESSAGE DIGEST, after all bytes in the second operand as specified ingeneral register R2+1 have been processed, the padding operation isperformed, and then normal completion occurs. When the operation endsdue to normal completion, condition code 0 is set and the resultingvalue in R2+1 is zero. When the operation ends due to partialcompletion, condition code 3 is set and the resulting value in R2+1 isnonzero. When the second-operand length is initially zero, the secondoperand is not accessed, general registers R2 and R2+1 are not changed,and condition code 0 is set. For COMPUTE INTERMEDIATE MESSAGE DIGEST,the parameter block is not accessed. However, for COMPUTE LAST MESSAGEDIGEST, the empty block (L=0) case padding operation is performed andthe result is stored into the parameter block. As observed by other CPUsand channel programs, references to the parameter block and storageoperands may be multiple-access references, accesses to these storagelocations are not necessarily block concurrent, and the sequence ofthese accesses or references is undefined. Access exceptions may bereported for a larger portion of the second operand than is processed ina single execution of the instruction; however, access exceptions arenot recognized for locations beyond the length of the second operand norfor locations more than 4K bytes beyond the current location beingprocessed.

KIMD-Query (KIMD Function Code 0)

A 128-bit status word is stored in the parameter block. Bits 0-127 ofthis field correspond to function codes 0-127, respectively, of theCOMPUTE INTERMEDIATE MESSAGE DIGEST instruction. When a hit is one, thecorresponding function is installed; otherwise, the function is notinstalled. Condition code 0 is set when execution of the KIMD Queryfunction completes; condition code 3 is not applicable to this function.

KIMD-SHA-1 (KIMD Function Code 1)

A 20-byte intermediate message digest is generated for the 64-bytemessage blocks in operand 2 using the SHA-1 block digest algorithm withthe 20-byte chaining value in the parameter block. The generatedintermediate message digest, also called the output chaining value(OCV), is stored in the chaining-value field of the parameter block.

KIMD-SHA-256 (KIMD Function Code 2)

A 32-byte intermediate message digest is generated for the 64-bytemessage blocks in operand 2 using the SHA-256 block digest algorithmwith the 32-byte chaining value in the parameter block. The generatedintermediate message digest, also called the output chaining value(OCV), is stored in the chaining-value field of the parameter block.

KIMD-SHA-512 (KIMD Function Code 3)

A 64-byte intermediate message digest is generated for the 128-bytemessage blocks in operand 2 using the SHA-512 block digest algorithmwith the 64-byte chaining value in the parameter block. The generatedintermediate message digest, also called the output chaining value(OCV), is stored in the chaining-value field of the parameter block.

KLMD-Query (KLMD Function Code 0)

A 128-bit status word is stored in the parameter block. Bits 0-127 ofthis field correspond to function codes 0-127, respectively, of theCOMPUTE LAST MESSAGE DIGEST instruction. When a bit is one, thecorresponding function is installed; otherwise, the function is notinstalled. Condition code 0 is set when execution of the KLMDQueryfunction completes; condition code 3 is not applicable to this function.

KLMD-SHA-1 (KLMD Function Code 1)

The message digest for the message (M) in operand 2 is generated usingthe SHA-1 algorithm with the chaining value and message-bit-lengthinformation in the parameter block. If the length of the message inoperand 2 is equal to or greater than 64 bytes, an intermediate messagedigest is generated for each 64-byte message block using the SHA-1 blockdigest algorithm with the 20-byte chaining value in the parameter block,and the generated intermediate message digest, also called the outputchaining value (OCV), is stored into the chaining-value field of theparameter block. This operation repeats until the remaining message isless than 64 bytes. If the length of the message or the remainingmessage is zero bytes, then the operation in is performed. If the lengthof the message or the remaining message is between one byte and 55 bytesinclusive, then the operation is performed; if the length is between 56bytes and 63 bytes inclusive, then the operation is performed. Themessage digest, also called the output chaining value (OCV), is storedinto the chaining value field of the parameter block.

KLMD-SHA-256 (KLMD Function Code 2)

The message digest for the message (M) in operand 2 is generated usingthe SHA-256 algorithm with the chaining value and message-bit-lengthinformation in the parameter block. If the message in operand 2 is equalto or greater than 64 bytes, an intermediate message digest is generatedfor each 64-byte message block using the SHA-256 block digest algorithmwith the 32-byte chaining value in the parameter block, and thegenerated intermediate message digest, also called the output chainingvalue (OCV), is stored into the chaining-value field of the parameterblock. This operation repeats until the remaining message is less than64 bytes. If the length of the message or the remaining message is zerobyte, then the operation is performed. If the length of the message orthe remaining message is between one byte and 55 bytes inclusive, thenthe operation is performed; if the length is between 56 bytes and 63bytes inclusive, then the operation is performed. The message digest,also called the output chaining value (OCV), is stored into the chainingvalue field of the parameter block.

KLMD-SHA-512 (KLMD Function Code 3)

The message digest for the message (M) in operand 2 is generated usingthe SHA-512 algorithm with the chaining value and message-bit-lengthinformation in the parameter block. If the message in operand 2 is equalto or greater than 128 bytes, an intermediate message digest isgenerated for each 128-byte message block using the SHA-512 block digestalgorithm with the 64-byte chaining value in the parameter block, andthe generated intermediate message digest, also called the outputchaining value (OCV), is stored into the chaining-value field of theparameter block. This operation repeats until the remaining message isless than 128 bytes. If the length of the message or the remainingmessage is zero byte, then the operation is performed. If the length ofthe message or the remaining message is between one byte and 111 bytesinclusive, then the operation is performed; if the length is between 112bytes and 127 bytes inclusive, then the operation is performed. Themessage digest, also called the output chaining value (OCV), is storedinto the chaining-value field of the parameter block.

Compute Message Authentication Code (KMAC) Instruction

When executed by a computer system, a function specified by the functioncode in general register 0 is performed. Bits 16-23 of the instructionand the R1 field are ignored. Bit positions 57-63 of general register 0contain the function code. All other function codes are unassigned. Bit56 of general register 0 must be zero; otherwise, a specificationexception is recognized. All other bits of general register 0 areignored. General register 1 contains the logical address of the leftmostbyte of the parameter block in storage. In the 24-bit addressing mode,the contents of bit positions 40-63 of general register 1 constitute theaddress, and the contents of bit positions 0-39 are ignored. In the31-bit addressing mode, the contents of bit positions 33-63 of generalregister 1 constitute the address, and the contents of bit positions0-32 are ignored. In the 64-bit addressing mode, the contents of bitpositions 0-63 of general register 1 constitute the address. The queryfunction provides the means of indicating the availability of the otherfunctions. The contents of general registers R2 and R2+1 are ignored.For all other functions, the second operand is processed as specified bythe function code using an initial chaining value in the parameter blockand the result replaces the chaining value. The operation also uses acryptographic key in the parameter block. The operation proceeds untilthe end of the second operand location is reached or a CPU-determinednumber of bytes have been processed, whichever occurs first. The resultis indicated in the condition code. The R2 field designates an even-oddpair of general registers and must designate an even-numbered register;otherwise, a specification exception is recognized. The location of theleftmost byte of the second operand is specified by the contents of theR2 general register. The number of bytes in the second-operand locationis specified in general register R2+1. As part of the operation, theaddress in general register R2 is incremented by the number of bytesprocessed from the second operand, and the length in general registerR2+1 is decremented by the same number. The formation and updating ofthe address and length is dependent on the addressing mode. In the24-bit addressing mode, the contents of bit positions 40-63 of generalregister R2 constitute the address of second operand, and the contentsof bit positions 0-39 are ignored; bits 40-63 of the updated addressreplace the corresponding bits in general register R2, carries out ofbit position 40 of the updated address are ignored and, the contents ofbit positions 32-39 of general register R2 are set to zeros. In the31-bit addressing mode, the contents of bit positions 33-63 of generalregister R2 constitute the address of second operand, and the contentsof bit positions 0-32 are ignored; bits 33-63 of the updated addressreplace the corresponding bits in general register R2, carries out ofbit position 33 of the updated address are ignored, and the content ofbit position 32 of general register R2 is set to zero. In the 64-bitaddressing mode, the contents of bit positions 0-63 of general registerR2 constitute the address of second operand; bits 0-63 of the updatedaddress replace the contents of general register R2 and carries out ofbit position 0 are ignored. In both the 24-bit and the 31-bit addressingmodes, the contents of bit positions 32-63 of general register R2+1 forma 32-bit unsigned binary integer which specifies the number of bytes inthe second operand; and the updated value replaces the contents of bitpositions 32-63 of general register R2+1. In the 64-bit addressing mode,the contents of bit positions 0-63 of general register R2+1 form a64-bit unsigned binary integer which specifies the number of bytes inthe second operand; and the updated value replaces the contents ofgeneral register R2+1. In the 24-bit or 31-bit addressing mode, thecontents of bit positions 0-31 of general registers R2 and R2+1, alwaysremain unchanged. In the access-register mode, access registers 1 and R2specify the address spaces containing the parameter block and secondoperand, respectively. The result is obtained as if processing starts atthe left end of the second operand and proceeds to the right, block byblock. The operation is ended when all source bytes in the secondoperand have been processed (called normal completion), or when a CPUdetermined number of blocks that is less than the length of the secondoperand have been processed (called partial completion). TheCPU-determined number of blocks depends on the model, and may be adifferent number each time the instruction is executed. TheCPU-determined number of blocks is usually nonzero. In certain unusualsituations, this number may be zero, and condition code 3 may be setwith no progress. However, the CPU protects against endless reoccurrenceof this no-progress case. When the chaining-value field overlaps anyportion of the second operand, the result in the chaining-value field isunpredictable. Normal completion occurs when the number of bytes in thesecond operand as specified in general register R2+1 have beenprocessed. When the operation ends due to normal completion, conditioncode 0 is set and the resulting value in R2+1 is zero. When theoperation ends due to partial completion, condition code 3 is set andthe resulting value in R2+1 is nonzero. When the second-operand lengthis initially zero, the second operand and the parameter block are notaccessed, general registers R2 and R2+1 are not changed, and conditioncode 0 is set. As observed by other CPUs and channel programs,references to the parameter block and storage operands may bemultiple-access references, accesses to these storage locations are notnecessarily block concurrent, and the sequence of these accesses orreferences is undefined. Access exceptions may be reported for a largerportion of the second operand than is processed in a single execution ofthe instruction; however, access exceptions are not recognized forlocations beyond the length of the second operand nor for locations morethan 4K bytes beyond the current location being processed.

KMAC-Query (Function Code 0)

A 128-bit status word is stored in the parameter block. Bits 0-127 ofthis field correspond to function codes 0-127, respectively, of the KMACinstruction. When a bit is one, the corresponding function is installed;otherwise, the function is not installed. Condition code 0 is set whenexecution of the KMAC Query function completes; condition code 3 is notapplicable to this function.

KMAC-DEA (Function Code 1)

The message authentication code for the 8-byte message blocks (M1, M2, .. . , Mn) in operand 2 is computed using the DEA algorithm with the64-bit cryptographic key and the 64-bit chaining value in the parameterblock. The message authentication code, also called the output chainingvalue (OCV), is stored in the chaining-value field of the parameterblock.

KMAC-TDEA-128 (Function Code 2)

The message authentication code for the 8-byte message blocks (M1, M2, .. . , Mn) in operand 2 is computed using the TDEA algorithm with the two64-bit cryptographic keys and the 64-bit chaining value in the parameterblock. The message authentication code, also called the output chainingvalue (OCV), is stored in the chaining-value field of the parameterblock.

KMAC-TDEA-192 (Function Code 3)

The message authentication code for the 8-byte message blocks (M1, M2, .. . , Mn) in operand 2 is computed using the TDEA algorithm with thethree 64-bit cryptographic keys and the 64-bit chaining value in theparameter block. The message authentication code, also called the outputchaining value (OCV), is stored in the chaining-value field of theparameter block.

Perform Locked Operation Instruction

When executed by a computer system, after the lock specified in generalregister 1 has been obtained, the operation specified by the functioncode in general register 0 is performed, and then the lock is released.However, as observed by other CPUs: (1) storage operands, includingfields in a parameter list that may be used, may be fetched, and may betested for store-type access exceptions if a store at a tested locationis possible, before the lock is obtained, and (2) operands may be storedin the parameter list after the lock has been released. If an operandnot in the parameter list is fetched before the lock is obtained, it isfetched again after the lock has been obtained. The function code canspecify any of six operations: compare and load, compare and swap,double compare and swap, compare and swap and store, compare and swapand double store, or compare and swap and triple store. A test bit ingeneral register 0 specifies, when one, that a lock is not to beobtained and none of the six operations is to be performed but, instead,the validity of the function code is to be tested. This will be usefulif additional function codes for additional operations are assigned inthe future. This definition is written as if the test bit is zero exceptwhen stated otherwise. If compare and load is specified, thefirst-operand comparison value and the second operand are compared. Ifthey are equal, the fourth operand is placed in the third-operandlocation. If the comparison indicates inequality, the second operand isplaced in the first-operand-comparison-value location as a newfirst-operand comparison value. If compare and swap is specified, thefirst-operand comparison value and the second operand are compared. Ifthey are equal, the first-operand replacement value is stored at thesecond-operand location. If the comparison indicates inequality, thesecond operand is placed in the first-operand-comparison value locationas a new first-operand comparison value. If double compare and swap isspecified, the first operand comparison value and the second operand arecompared. If they are equal, the third-operand comparison value and thefourth operand are compared. If both comparisons indicate equality, thefirst operand and third-operand replacement values are stored at thesecond-operand location and fourth operand location, respectively. Ifthe first comparison indicates inequality, the second operand is placedin the first-operand-comparison-value location as a new first-operandcomparison value. If the first comparison indicates equality but thesecond does not, the fourth operand is placed in thethird-operand-comparison-value location as a new third-operandcomparison value. If compare and swap and store, double store, or triplestore is specified, the first-operand comparison value and the secondoperand are compared. If they are equal, the first-operand replacementvalue is stored at the second-operand location, and the third operand isstored at the fourth-operand location. Then, if the operation is thedouble-store or triple-store operation, the fifth operand is stored atthe sixth-operand location, and, if it is the triple-store operation,the seventh operand is stored at the eighth-operand location. If thefirst-operand comparison indicates inequality, the second operand isplaced in the first operand-comparison-value location as a new firstoperand comparison value. After any of the six operations, the result ofthe comparison or comparisons is indicated in the condition code. Thefunction code (FC) is in bit positions 56-63 of general register 0. Thefunction code specifies not only the operation to be performed but alsothe length of the operands and whether the first-operand comparison andreplacement values and the third operand or third-operand comparison andreplacement values, which are referred to collectively simply as thefirst and third operands, are in general registers or a parameter list.The pattern of the function codes is as follows: • A function code thatis a multiple of 4 (including 0) specifies a 32-bit length with thefirst and third operands in bit positions 32-63 of general registers. •A function code that is one more than a multiple of 4 specifies a 64-bitlength with the first and third operands in a parameter list. • Afunction code that is 2 more than a multiple of 4 specifies a 64-bitlength with the first and third operands in bit positions 0-63 ofgeneral registers. • A function code that is 3 more than a multiple of 4specifies a 128-bit length with the first and third operands in aparameter list.

For example, PLO.DCS may be used to mean PERFORM LOCKED OPERATION withfunction code 8. In the symbols, the letter “G” indicates a 64-bitoperand length, the letter “R” indicates that some or all 64-bitoperands are in general registers, and the letter “X” indicates a128-bit operand length. Function codes that have not been assigned tooperations or that specify operations that the CPU cannot performbecause the operations are not implemented (installed) are calledinvalid. Bit 55 of general register 0 is the test bit (T). When bit 55is zero, the function code in general register 0 must be valid;otherwise, a specification exception is recognized. When bit 55 is one,the condition code is set to 0 if the function code is valid or to 3 ifthe function code is invalid, and no other operation is performed. Bits32-54 of general register 0 must be all zeros; otherwise, aspecification exception is recognized. When bit 55 of the register isone, this is the only exception that can be recognized. Bits 0-31 ofgeneral register 0 are ignored. The lock to be used is represented by aprogram lock token (PLT) whose logical address is specified in generalregister 1. In the 24-bit addressing mode, the PLT address is bits 40-63of general register 1, and bits 0-39 of the register are ignored. In the31-bit addressing mode, the PLT address is bits 33-63 of the register,and bits 0-32 of the register are ignored. In the 64-bit addressingmode, the PLT address is bits 0-63 of the register. For theeven-numbered function codes, including 0, the first-operand comparisonvalue is in general register R1. For the even-numbered function codesbeginning with 4, the first-operand replacement value is in generalregister R1+1, and R1 designates an even-odd pair of registers and mustdesignate an even-numbered register; otherwise, a specificationexception is recognized. For function codes 0 and 2, R1 can be even orodd. For function codes 0, 2, 12, and 14, the third operand is ingeneral register R3, and R3 can be even or odd. For function codes 8 and10, the third-operand comparison value is in general register R3, thethird-operand replacement value is in general register R3+1, and R3designates an even-odd pair of registers and must designate aneven-numbered register; otherwise, a specification exception isrecognized. For all function codes, the B2 and D2 fields of theinstruction specify the second-operand address. For function codes 0, 2,8, 10, 12, and 14, the B4 and D4 fields of the instruction specify thefourth-operand address. For function codes 1, 3, 5, 7, 9, 11, 13, 15,and 16-23, the B4 and D4 fields of the instruction specify the addressof a parameter list that is used by the instruction, and this address isnot called the fourth operand address. The parameter list contains oddnumbered operands, including comparison and replacement values, andaddresses of even-numbered operands other than the second operand. Inthe access-register mode, the parameter list also containsaccess-list-entry tokens (ALETs) associated with theeven-numbered-operand addresses. In the access-register mode, forfunction codes that cause use of a parameter list containing an ALET, R3must not be zero; otherwise, a specification exception is recognized.Operand addresses in a parameter list, if used, are in doublewords inthe list. In the 24-bit addressing mode, an operand address is bits40-63 of a doubleword, and bits 0-39 of the doubleword are ignored. Inthe 31-bit addressing mode, an operand address is bits 33-63 of adoubleword, and bits 0-32 of the doubleword are ignored. In the 64-bitaddressing mode, an operand address is bits 0-63 of a doubleword. In theaccess-register mode, access register 1 specifies the address spacecontaining the program lock token (PLT), access register B2 specifiesthe address space containing the second operand, and access register B4specifies the address space containing a fourth operand or a parameterlist. Also, for an operand whose address is in the parameter list, anaccesslist-entry token (ALET) is in the list along with the address andis used in the access-register mode to specify the address spacecontaining the operand. In the access-register mode, if an accessexception or PER storage-alteration event is recognized for an operandwhose address is in the parameter list, the associated ALET in theparameter list is loaded into access register R3 when the exception orevent is recognized. Then, during the resulting program interruption, ifa value is due to be stored as the exception access identification atreal location 160 or the PER access identification at real location 161,R3 is stored. If the instruction execution is completed without therecognition of an exception or event, the contents of access register R3are unpredictable. When not in the access-register mode, or when aparameter list containing an ALET is not used, the contents of accessregister R3 remain unchanged. The even-numbered (2, 4, 6, and 8) storageoperands must be designated on an integral boundary, which is a wordboundary for function codes that are a multiple of 4, a doublewordboundary for function codes that are one or 2 more than a multiple of 4,or a quadword boundary for function codes that are 3 more than amultiple of 4. A parameter list, if used, must be designated on adoubleword boundary. Otherwise, a specification exception is recognized.The program-lock-token (PLT) address in general register 1 does not havea boundary-alignment requirement. All unused fields in a parameter listshould contain all zeros; otherwise, the program may not operatecompatibly in the future. A serialization function is performedimmediately after the lock is obtained and again immediately before itis released. However, values fetched from the parameter list before thelock is obtained are not necessarily re-fetched. A serializationfunction is not performed if the test bit, bit 55 of general register 0,is one.

Function Codes 0-3 (Compare and Load)

The first-operand comparison value is compared to the second operand.When the first-operand comparison value is equal to the second operand,the third operand is replaced by the fourth operand, and condition code0 is set. When the first-operand comparison value is not equal to thesecond operand, the first-operand comparison value is replaced by thesecond operand, and condition code 1 is set.

Function Codes 4-7 (Compare and Swap)

The first-operand comparison value is compared to the second operand.When the first-operand comparison value is equal to the second operand,the first operand replacement value is stored at the second operandlocation, and condition code 0 is set. When the first-operand comparisonvalue is not equal to the second operand, the first-operand comparisonvalue is replaced by the second operand, and condition code 1 is set.

Function Codes 8-11 (Double Compare and Swap)

The first-operand comparison value is compared to the second operand.When the first-operand comparison value is equal to the second operand,the third operand comparison value is compared to the fourth operand.When the third-operand comparison value is equal to the fourth operand(after the first-operand comparison value has been found equal to thesecond operand), the first-operand replacement value is stored at thesecond-operand location, the third operand replacement value is storedat the fourth operand location, and condition code 0 is set. When thefirst-operand comparison value is not equal to the second operand, therust-operand comparison value is replaced by the second operand, andcondition code 1 is set. When the third-operand comparison value is notequal to the fourth operand (after the first-operand comparison valuehas been found equal to the second operand), the third-operandcomparison value is replaced by the fourth operand, and condition code 2is set.

Function Codes 12-15 (Compare and Swap and Store)

The first-operand comparison value is compared to the second operand.When the first-operand comparison value is equal to the second operand,the first operand location, the third operand is stored at thefourth-operand location, and condition code 0 is set. When thefirst-operand comparison value is not equal to the second operand, thefirst-operand comparison value is replaced by the second operand, andcondition code 1 is set.

Function Codes 16-19 (Compare and Swap and Double Store)

The first-operand comparison value is compared to the second operand.When the first-operand comparison value is equal to the second operand,the first operand replacement value is stored at the second operandlocation, the third operand is stored at the fourth-operand location,the fifth operand is stored at the sixth-operand location, and conditioncode 0 is set. When the first-operand comparison value is not equal tothe second operand, the first-operand comparison value is replaced bythe second operand, and condition code 1 is set.

Function Codes 20-23 (Compare and Swap and Triple Store)

The first-operand comparison value is compared to the second operand.When the first-operand comparison value is equal to the second operand,the first operand replacement value is stored at the second operandlocation, the third operand is stored at the fourth-operand location,the fifth operand is stored at the sixth-operand location, the seventhoperand is stored at the eighth-operand location, and condition code 0is set. When the first-operand comparison value is not equal to thesecond operand, the first-operand comparison value is replaced by thesecond operand, and condition code 1 is set.

Locking

A lock is obtained at the beginning of the operation and released at theend of the operation. The lock obtained is represented by a program locktoken (PLT) whose logical address is specified in general register 1 asalready described. A PLT is a value produced by a model-dependenttransformation of the PLT logical address. Depending on the model, thePLT may be derived directly from the PLT logical address or, when DAT ison, from the real address that results from transformation of the PLTlogical address by DAT. If DAT is used, access register translation(ART) precedes DAT in the access-register mode. A PLT selects one of amodel-dependent number of locks within the configuration. Programs beingexecuted by different CPUs can be assured of specifying the same lockonly by specifying PLT logical addresses that are the same and that canbe transformed to the same real address by the different CPUs. Since amodel may or may not use ART and DAT when forming a PLT,access-exception conditions that can be encountered during ART and DATmay or may not be recognized as exceptions. There is no accessing of alocation designated by a PLT, but an addressing exception may berecognized for the location. A protection exception is not recognizedfor any reason during processing of a PLT logical address. The CPU canhold one lock at a time. When PERFORM LOCKED OPERATION is executed bythis CPU and is to use a lock that is already held by another CPU due tothe execution of a PERFORM LOCKED OPERATION instruction by the otherCPU, the execution by this CPU is delayed until the lock is no longerheld. An excessive delay can be caused only by a machine malfunction andis a machine-check condition. The order in which multiple requests forthe same lock are satisfied is undefined. A non-recoverable failure of aCPU while holding a lock may result in a machine check, entry into thecheck-stop state, or system check stop. The machine check is processingbackup if all operands are undamaged or processing damage if registeroperands are damaged. If a machine check or the check-stop state is theresult, either no storage operands have been changed or else all storageoperands that were due to be changed have been correctly changed, and,in either case, the lock has been released. If the storage operands arenot in either their correct original state or their correct final state,the result is system check stop.

Perform Floating-Point Operation Instruction:

When executed by a computer system, the operation specified by thefunction code in general register 0 is performed and the condition codeis set to indicate the result. When there are no exceptional conditions,condition code 0 is set. When an IEEE non-trap exception is recognized,condition code 1 is set. When an IEEE trap exception with alternateaction is recognized, condition code 2 is set. A 32-bit return code isplaced in bits 32-63 of general register 1; bits 0-31 of generalregister 1 remain unchanged. The PERFORM FLOATING-POINT OPERATION (PFPO)instruction is subject to the AFP-register control bit, bit 45 ofcontrol register 0. For PFPO to be executed successfully, theAFP-register-control bit must be one; otherwise, an AFP-register dataexception, DXC 1, is recognized. Bit 32 of general register 0 is thetest bit. When bit 32 is zero, the function specified by bits 33-63 ofgeneral register 0 is performed; each field in bits 33-63 must be validand the combination must be a valid and installed function; otherwise aspecification exception is recognized. When bit 32 is one, the functionspecified by bits 33-63 is not performed but, instead, the conditioncode is set to indicate whether these bits specify a valid and installedfunction; the condition code is set to 0 if the function is valid andinstalled, or to 3 if the function is invalid or not installed. Thiswill be useful if additional functions are assigned in the future. Thisdefinition is written as if the test bit is zero except when statedotherwise.

Bits 33-39 of GR0 specify the operation type. Only one operation type iscurrently defined: 01, hex, is PFPO Convert Floating-Point Radix. Forthe PFPO-convert-floating-point-radix operation, other fields in generalregister 0 include first-operand format, second operand format, controlflags, and rounding method. For the PFPO-convert-floating point-radixoperation, the second operand is converted to the format of the firstoperand and placed at the first-operand location, a return code isplaced in bits 32-63 of general register 1, and the condition code isset to indicate whether an exceptional condition was recognized. Thefirst and second operands are in implicit floating point registers. Thefirst operand is in FPR0 (paired with FPR2 for extended). The secondoperand is in FPR4 (paired with FPR6 for extended).

Alternate-Exception-Action Control:

Bit 57 of general register 0 is the alternate-exception-action control.The setting of this control affects the action taken for IEEE-overflowand IEEE-underflow trap exceptions. When the alternate-exception-actioncontrol is zero, IEEE-overflow and IEEE-underflow trap exceptions arereported in the normal manner. That is, the appropriate data exceptioncode (DXC) is placed in byte 2 of the floating-point control register,the operation is completed, and a program interruption for a dataexception occurs. (As part of the program interruption, the DXC isstored at location 147.) This is called an IEEE trap exception withnormal action. When the alternate-exception-action control is one, theDXC is placed in byte 2 of the floating-point control register, theoperation is completed, condition code 2 is set, and program executioncontinues with the next sequential instruction. (There is no programinterruption and the DXC is not stored at location 147.) This is calledan IEEE trap exception with alternate action.

HFP-Overflow Control

Bit 58 of general register 0 is the HFP-overflow control. When theHFP-overflow control is zero, an HFP-overflow condition is reported asan IEEE-invalid-operation exception and is subject toIEEE-invalid-operation mask. When the HFP-overflow control is one, anHFP-overflow condition is reported as an IEEE-overflow exception and issubject to the IEEE-overflow mask. The HFP-overflow control is definedonly for HFP targets; when other than an HFP target is specified, thisbit must be zero.

HFP-Underflow Control:

For HFP targets, bit 59 of general register 0 is the HFP alternateunderflow control. When the HFP-underflow control is zero, HFP underflowcauses the result to be set to a true zero with the same sign as thesource and underflow is not reported. (The result in this case isinexact and subject to the inexact-suppression control.) When theHFP-underflow control is one, the condition is reported as anIEEE-underfloor exception and is subject to the IEEE-underflow mask. Bit59 of general register 0 is defined only for HFP and DFP targets; when aBFP target is specified, this bit must be zero.

DFP Preferred Quantum Control (DPQC):

For DFP targets, bit 59 of general register 0 is the DFP preferredquantum control (DPQC). For radix conversion with DFP targets, if thedelivered value is inexact, the cohort member with the smallest quantumis selected; if the delivered value is exact, selection depends on thevalue of bit 59 of general register 0, the DFP preferred quantum control(DPQC). When the delivered value is exact and the DPQC bit is zero, thecohort member with the largest quantum is selected. When the deliveredvalue is exact and the DPQC bit is one, the preferred quantum is one andthe cohort member with the quantum closest to one is selected.

Return Code

Regardless of what condition code is set, and independent of whether thetest bit is one, a 32-bit return code is placed in bits 32-63 of generalregister 1; bits 0-31 of general register 1 remain unchanged. A returncode is also placed in general register 1 when a program interruptionoccurs for an IEEE trap exception that completes; general register 1 isnot updated when a program interruption occurs for an IEEE trapexception that suppresses. Thus, general register 1 is updated on aprogram interruption for IEEE-overflow, IEEE-underfloor, andIEEE-inexact trap exceptions, but is not updated on a programinterruption for an IEEE-invalid-operation trap exception. Except whereotherwise specified, the return code is a value of zero.

Sign Preservation

For PFPO convert floating-point radix, the sign of the result is thesame as the sign of the source. The only exception to this is when thesource is a NaN and the target is HFP; in this case, the result is thelargest representable number in the target HFP format (Hmax) with thesign set to plus.

Preferred Quantum

For radix conversion with DFP targets, if the delivered value isinexact, the cohort member with the smallest quantum is selected; if thedelivered value is exact, selection depends on the value of bit 59 ofgeneral register 0, the DFP preferred quantum control (DPQC). When thedelivered value is exact and the DPQC bit is zero, the cohort memberwith the largest quantum is selected. When the delivered value is exactand the DPQC bit is one, the preferred quantum is one and the cohortmember with the quantum closest to one is selected.

NaN Conversion

When converting between DFP and BFP, the sign of the NaN is alwayspreserved, and the value of the payload is preserved, when possible. Ifthe value of the source payload exceeds the maximum value of the targetpayload, the target is set to the default QNaN, but with the same signas the source. When traps are disabled, an SNaN is converted to thecorresponding QNaN, and the payload is preserved, when possible; thatis, SNaN(x) is converted to QNaN(x), where x is the value of thepayload. For DFP, both QNaN(0) and SNaN(0) can be represented; but inBFP, there is a representation for QNaN(0), but not for SNaN(0).

Scaled Value and Signed Scaling Exponent (□) for PFPO

When, for the PFPO-convert-floating-point-radix operation, IEEE-overflowtrap action or IEEE-underflow trap action occurs, the scaled value iscomputed using the following steps:

=b

z=g+

Where

is the signed scaling exponent, b is the target radix (2, 10, or 16),

is the scale factor, g is the precision-rounded value, and z is thescaled value. The signed scaling exponent (□) is selected to make themagnitude of the value of the scaled result (z) lie in the range: 1[|z|<b. The value of the signed scaling exponent (□), treated as a32-bit signed binary integer, is placed in bits 32-63 of generalregister 1; bits 0-31 of general register 1 remain unchanged. The scaledvalue is used as the delivered value and is placed in the resultlocation. For DFP targets, the cohort member with the quantum nearest tothe scaled preferred quantum is selected. (But it should be noted thatfor all currently supported conversions, the result is always inexact,so the cohort member with the smallest quantum is selected.) For BFPtargets, there are no redundant representations, there is only onemember in a cohort. For HFP targets, the result is normalized.

HFP Values

Unnormalized HFP values are accepted on input, but all HFP results arenormalized. If an HFP result would be less than the smallest (inmagnitude) representable normalized number, an HFP underflow conditionexists.

HFP Overflow and Underflow for PFPO

For an HFP target of a PFPO-convert-floating-pointradix operation, thehandling of overflow and underflow conditions is controlled by theHFP-overflow control and the HFP-underflow control, respectively.

HFP Overflow: An HFP-overflow condition exists when an HFP targetprecision's largest number (Hmax) is exceeded in magnitude by theprecision rounded value. That is, when the characteristic of anormalized HFP result would exceed 127 and the fraction is not zero.When the HFP-overflow control is zero, HFP-overflow is reported as anIEEE-invalid-operation exception and is subject to theIEEE-invalid-operation mask in the FPC register. This is called anHFP-overflow-as-IEEE-invalid-operation condition. When the HFP-overflowcontrol is one, HFP overflow is reported as an IEEE-overflow exceptionand is subject to the IEEE-overflow mask in the FPC register. This iscalled an HFP-overflow-as-IEEE-overflow condition.

HFP Underflow: An HFP-underflow condition exists when theprecision-rounded value is nonzero and less in magnitude than the HFPtarget precision's smallest normalized number, Hmin. That is, when thecharacteristic of a normalized HFP result would be less than zero andthe fraction is not zero. The result is set to a true zero with the samesign as the source. Reporting of the HFP-underflow condition is subjectto the HFP-underflow control. The result in this case, however, isinexact and is subject to the controls for that condition. When theHFP-underflow control is zero, the HFP underflow condition is notreported. When the HFP-underflow control is one, HFP underflow isreported as an IEEE-underflow exception and is subject to theIEEE-underflow mask in the FPC register. This is called anHFP-underflow-as-IEEE underflow condition.

Perform Timing Facility Function Instruction:

When executed by a computer system, a timing facility function specifiedby the function code in general register 0 is performed. The conditioncode is set to indicate the outcome of the function. General register 1contains the address of a parameter block in storage. PTFF queryfunctions place information in the parameter block; PTFF controlfunctions use information obtained from the parameter block. As observedby other CPUs and channel programs, references to the parameter blockmay be multiple access references, accesses to these storage locationsare not necessarily block-concurrent, and the sequence of these accessesor references is undefined. Bit positions 57-63 of general register 0contain the function code. Bit 56 of general register 0 must be zero;otherwise, a specification exception is recognized. All other bits ofgeneral register 0 are ignored. General register 1 contains the logicaladdress of the leftmost byte of the parameter block in storage. In the24-bit addressing mode, the contents of bit positions 40-63 of generalregister 1 constitute the address, and the contents of bit positions0-39 are ignored. In the 31-bit addressing mode, the contents of bitpositions 33-63 of general register 1 constitute the address, and thecontents of bit positions 0-32 are ignored. In the 64-bit addressingmode, the contents of bit positions 0-63 of general register 1constitute the address. The PTFF-QAF (Query Available Functions)function provides the means of indicating the availability of the otherfunctions. The PTFF-QAF function indicates whether the function isinstalled for a program running in supervisor state at the basic-machinelevel.

PTFF-QAF (Query Available Functions)

The parameter block used for the function has the following format: A128-bit field is stored in the parameter block. Bits 0-127 of this fieldcorrespond to function codes 0-127, respectively, of the PTFFinstruction. When a bit is one, the corresponding function is installed;otherwise, the function is not installed. Bits 0-3 of pb.w1 are set toones, as these bits represent function codes 0-3, which are currentlyassigned to query functions. Bits 4-31 of pb.w1 are reserved foradditional query functions. Bits 0-3 of pb.w3 are set to ones, as thesebits represent function codes 64-67, which are currently assigned tocontrol functions. Bits 4-31 of pb.w3 are reserved for additionalcontrol functions. Parameter block words pb.w2 and pb.w4 are reservedfor future extensions.

PTFF-QTO (Query TOD Offset)

The 64-bit physical-clock value returned (pb.Tu) is the value of thephysical clock at the most recent TOD-offset-update event. The 64-bitTOD-offset value returned (pb.d) indicates the value of the TOD-offset(d). This is the current value being added to Tr (the physical clock) toobtain Tb (the basic-machine TOD clock); that is, Tb=Tr+pb.d. The 64-bitlogical-TOD-offset value returned (pb.dl) indicates the current valuebeing added to Tr (the physical clock) to obtain Tc (the logical TODclock for the current level of CPU execution); that is, Tc=Tr+pb.dl.Thus, when executed at the basic-machine level, pb.dl=pb.d=d; whenexecuted at the logical partition level, the Tp-Tb epoch difference (Dp)is added, resulting in pb.dl=d+Dp; and when executed at thevirtual-machine level, the Tv-Tp epoch difference (Dv) is also added,resulting in pb.dl=d+Dp+Dv. Carries, if any, out of bit position 0 areignored in the addition for each of these equations. The 64-bit TODepoch difference value returned (pb.ed) is the TOD epoch difference forthe current level of CPU execution. When executed at the basic machinelevel, this value is zero; when executed at the logical-partition level,this value is the Tp-Tb epoch difference (Dp); when executed at thevirtual machine level, this value is the Tv-Tp epoch difference (Dv).

PTFF-QSI (Query Steering Information)

The 64-bit physical-clock value returned (pb.Tu) is the value of thephysical clock at the most recent TOD-offset-update event. The remainingfields are the values of the old-episode and new-episode registers.

PTFF-QPT (Query Physical Clock)

The 64-bit physical-clock value returned (pb.Tr) is the current value ofthe physical clock. Zeros are stored for the rightmost bit positionsthat are not provided by the physical clock. When the clock is running,two executions of PTFF-QPT, either on the same or different CPUs, do notnecessarily return different values of the clock.

PTFF-ATO (Adjust TOD Offset)

The 64-bit value (pb.a) from the parameter block, treated as anunsigned-binary value, is added to the base offset of the next episode.A carry if any, out of bit position 0 is ignored in this addition. Theeffect is not immediate, but is scheduled to coincide with the nextTOD-offset-update event. If the next episode has already been scheduled,and has not yet become active, then the sum of pb.a and new.b replacesnew.b and no other action is taken. If the next episode has not beenscheduled (that is, the new-episode registers are the current episode),then the new-episode registers are saved in the old episode registersand a new episode is scheduled (thus, making the old-episode registersthe current episode). The new-episode start time (new.s) is set to thevalue the physical clock will have at the next TOD-offset-update eventand the new-episode base offset (new.b) is set to the sum of pb.a andthe value the TOD-offset would have had at that same instant, computedusing the current steering parameters. The steering rate is not changedby this function, if a new episode is scheduled, the new-episodefinesteering and gross-steering rates are the same as the currentvalues. Execution of the adjust-TOD-offset function is interlocked suchthat the entire contents of the TOD-offset register appear to be updatedconcurrently and simultaneously as observed by all CPUs in theconfiguration. However, accesses to the logical TOD clocks(basic-machine TOD clock, logical-partition TOD clock, andvirtual-machine TOD clock) by CPUs in the configuration are notartificially delayed; thus, addition of a large unsigned adjustmentvalue may have the effect of a negative change and may cause the logicalTOD clocks to appear to step backwards.

PTFF-STO (Set TOD Offset)

The 64-bit value (pb.d) from the parameter block replaces the TODoffset. When issued at the basic-machine level, the effect is notimmediate, but is scheduled to coincide with the next TOD-offset-updateevent. If the next episode has already been scheduled, and has not yetbecome active, then pb.d replaces new.b and no other action is taken. Ifthe next episode has not been scheduled (that is, the hew-episoderegisters are the current episode), then the new-episode registers aresaved in the old episode registers and a new episode is scheduled (thus,making the old-episode registers the current episode). The new-episodestart time (new.s) is set to the value the physical clock will have atthe next TOD-offset-update event and the new-episode base offset (new.b)is set to the value of pb.d. The steering rate is not changed by thisfunction, if a new episode is scheduled, the new-episode fine steeringand gross-steering rates are the same as the current values. When issuedat the logical-partition or virtual machine level, the function may besimulated by the hypervisor and operates on the TOD epoch difference forthe current level of CPU execution (Dp or Dv, respectively); no newepisode is scheduled and the change takes effect immediately. Executionof the set-TOD-offset function is interlocked such that the entirecontents of the TOD-offset register appear to be updated concurrentlyand simultaneously as observed by all CPUs in the configuration.However, accesses to the logical TOD clocks (basic-machine TOD clock,logical-partition TOD clock, and virtual-machine TOD clock) by CPUs inthe configuration are not artificially delayed; thus, replacement of theTOD offset by a smaller value may cause the logical TOD clocks to appearto step backwards.

PTFF-SFS (Set Fine-Steering Rate)

The 32-bit value (pb.f) from the parameter block becomes thefine-steering rate for the next episode. The effect is not immediate,but is scheduled to coincide with the next TOD-offset-update event. Ifthe next episode has already been scheduled, and has not yet becomeactive, then pb.f replaces new.f and no other action is taken. If thenext episode has not been scheduled (that is, the new-episode registersare the current episode), then the new-episode registers are saved inthe old episode registers and a new episode is scheduled (thus, makingthe old-episode registers the current episode). The new-episode starttime (new.s) is set to the value the physical clock will have at thenext TOD-offset-update event and the new-episode base offset (new.b) isset to the value the TOD-offset will have at that same instant, computedusing the current steering parameters. The new-episode fine steeringrate (new.f) is set to pb.f and the new-episode gross-steering rate isthe same as the current value. When the new episode takes effect,accesses to the logical TOD clocks by CPUs in the configuration areinterlocked to ensure that the logical TOD clocks appear to be uniqueand monotonically increasing as observed by all programs.

PTFF-SGS (Set Gross-Steering Rate)

The 32-bit value (pb.g) from the parameter block becomes thegross-steering rate for the next episode. The effect is not immediate,but is scheduled to coincide with the next TOD-offset-update event. Ifthe next episode has already been scheduled, and has not yet becomeactive, then pb.g replaces new.g and no other action is taken. If thenext episode has not been scheduled (that is, the new-episode registersare the current episode), then the new-episode registers are saved inthe old episode registers and a new episode is scheduled (thus, makingthe old-episode registers the current episode). The new-episode starttime (new.s) is set to the value the physical clock will have at thenext TOD-offset-update event and the new-episode base offset (new.b) isset to the value the TOD-offset will have at that same instant, computedusing the current steering parameters. The new-episode gross steeringrate (new.g) is set to pb.g and the new-episode fine-steering rate isthe same as the current value. When the new episode takes effect,accesses to the logical TOD clocks by CPUs in the configuration areinterlocked to ensure that the logical TOD clocks appear to be uniqueand monotonically increasing as observed by all programs.

Instruction Blocking Facility:

Referring to FIG. 8, the function of a Virtual Architecture Level (VAL)Instruction Blocking facility in a VM is shown. Each instruction to beexecuted in the VM (as shown in the Instructions in Storage column),includes an opcode. In some implementations, the opcode is a singlefield in the instruction 901 902 903 904. In other implementations,opcodes may be distributed in more than one field of the instruction 905(OpCode∥OC) 906 (OpCode∥OpCode). Preferably, circuits, microcode or acombination thereof, would determine, based on the opcode, whether theinstruction to be executed was supported or not by the current Virtualmachine. If it was not supported, a program interruption, for example aprogram exception would be indicated and the instruction suppressed.

In an implementation, the opcode of the instruction to be executed wouldbe used to index into an opcode table 907 to locate an entry associatedwith the opcode. The entry located, would include a code indicating themachine level supported by the opcode. In another implementation, eachVirtual machine would have an opcode table and the entry in the tablewould indicate whether the opcode was supported by the Virtual machine.

Referring to FIG. 9, the code (machine level (ML)) 1002 obtained fromthe table 907 would be compared 1005 against a state description entry(IBC) 1008 of a state description table 1004 of the Virtual machine, andif the machine level code 1002 was greater than the IBC statedescription entry 1008, the instruction would execute normally 1007,otherwise, the attempt to execute would result in a program exception1006. In another embodiment, fields of the instruction in addition to,or other than the OpCode field may be used to index into the opcodetable 907. For example, an opcode may have reserved fields (to be 0 orignored) in a prior machine architecture, that are employed in newerarchitecture levels to provide new function. An embodiment would includethese bits with the OpCode to index into the opcode table 907. Inanother embodiment the opcode table 907 may have fields in addition tothe ML field used to indicate the permitted use of reserved bits in theassociated instruction. For example, if the instruction has 4 reservebits, the ML table may contain 0000 if all the bits must be 0, or 1's inselected bits where a 1 indicates that corresponding previously reservedbits of the field can be 0 or 1 (permitting the newly introducedfunction of the instruction for the VM).

Instruction Test/Query Facility:

If a FUNCTION BLOCKING FACILITY of the Instruction Test/Query facilityis installed (FIG. 10), the Opcode table entry 1001 may, in anembodiment, additionally include a function code field (FCx) 1003 (or apointer to a function code table 1108). The function code field 1003 (orthe function code table 1108 entry 1107) is compared 1103 with thefunction code to be executed 1102. If the function code compares, theinstruction is permitted 1105 to use the function code, if the functioncode doesn't compare 1103, the instruction execution causes a programinterruption such as a program exception or specification exception(program check) 1104.

Referring to FIG. 11, if a FUNCTION TEST/QUERY BLOCKING FACILITY of theInstruction Test/Query facility is installed, if any query instruction1201 is executed to determine the installed function of the instruction,only the function codes permitted by the Virtual machine are returned1205. In an embodiment, a bit significant table 1108 is provided for theVirtual machine that is used by the Virtual machine to respond to suchqueries. In another embodiment, a mask is provided (not shown) to theVirtual machine to be ANDed with the installed function codes of theHost machine to create a result of permitted function codes 1107 of theinstruction in the VM.

Referring to FIG. 8, example z/Architecture instruction formats areshown. Format 901 depicts a 2 byte format wherein the OpCode (Op)occupies the high order byte, and general register fields R1 and R2occupy respective 4 bits of the remaining byte. Format 902 depicts a 2byte OpCode only instruction format. Format 903 depicts a 4 byte (word)instruction having a 1 byte OpCode (Op) followed by 3 register fields,(R1, X2 and B2) and then an immediate field called the Displacementfield (D2). Format 904 depicts a 4 byte instruction having a 4 byteOpCode (Op), followed by a 4 bit register field (B2) and then a 12 bitImmediate field (12). Format 905 depicts a 4 byte instruction having a 2byte OpCode (Op) followed by a 4 bit mask M1, followed by a 4 bit OpCodeextension (Op) and a reserved 4 bit field, followed by a 12 bitImmediate field (12). Format 906 depicts a 6 byte instruction having a 1byte OpCode (Op) followed by 3 register fields, (R1, X2 and B2) and thenan immediate field called the Displacement field (DL2) followed by a 8bit immediate field (DH2) and an 8 bit OpCode extension (Op).

Referring to FIGS. 8 and 9, in an embodiment, when an instruction isfetched for execution by a logical processor of a virtual machine, anOpcode Table 907 is searched, using the OpCode(s) of the instruction asa search argument. If an entry is found 1001 for the instruction, theentry includes information 1002 1003 for determining instructionpermission information. In a preferred embodiment, an entry includes afield 1002 that specifies a code (ML) indicating the machine level ofthe architecture supporting the instruction. A state description 1004 isprovided for each VM. The state description includes a field (IBC) 1005that represents the machine level of the architecture that the VM is tosimulate. If 1005, the machine level of the architecture supporting theinstruction (ML) is greater than the machine level of the architecturethat the VM is to simulate (IBC), a program Exception (Program Check) issignaled, and in an embodiment, the execution of the instruction may besuppressed. On the other hand, if the machine level of the architecturesupporting the instruction (ML) is not greater than the machine level ofthe architecture that the VM is to simulate (IBC), the instruction ispermitted to execute.

In some environments instructions are provided that are able to executeany of a plurality of functions (such as the CIPHER MESSAGE instructiondescribed supra). The selection of the function by an instruction may beby way of specifying a function code (FC) representing the function. TheFunction Code may be indirectly specified by the instruction orexplicitly specified by bits or fields of the instruction for example.In some cases, certain function codes may be initially implemented (0-3for example) in a machine architecture level, and additional functioncodes may be added at later machine architecture levels. The VM can beprovided with the capability to only permit function codes to execute ofan older architecture level.

Referring to FIG. 10, this may be accomplished by having a function codefield (FCx) 1003 in the Opcode Table Entry 1001. When an instruction isabout to be executed, the FCx field 1003 specifies the allowed functioncode list to be returned rather than the actual function codes supportedby the Host processor. In embodiment, the FCx 1003 field of the OpcodeTable entry is concatenated with the IBC field 1005 to index into an FCxTable 1108 to locate an entry that comprises permitted function codes(TVs) 1107. The permitted FCs 1107 are compared with the FC specified bythe instruction 1102 (in the Cipher Message instruction, bits 1102 ofgeneral register 0 1101 contain the specified FC 1102). If 1103 the FCvalue is permitted 1105, normal execution of the function represented bythe FC bits is permitted. If 1103 the FC value is not permitted 1104, aprogram exception (program check) event is performed. Similarly, whenexecuting a Function Query/test operation 1201 (such as the CIPHERMESSAGE instruction Query operation), the FCX bits of the Opcode TableEntry 1003 are concatenated 1106 with the IBC bits 1005 to index intothe FCX table to locate the permitted FCs 1107 for the instruction whoseOpCode locates the Opcode Table Entry 1001. The permitted FCs are thenreturned 1105 to the location specified by the Function Query/Testoperation.

In an embodiment, when the FCX bits are 0, no FCx Table 1108 access isperformed and any Function Code indicated by the correspondinginstruction is used without translation.

In an embodiment, other architecture modifications to instructions canuse the same mechanism as described for Function codes. In this case forexample, instruction 905 at an architectural level has the bits betweenthe OpCode extension field and the I2 field, reserved (0000).Preferably, the reserved bits are tested for 0's to make sure theinstruction will perform properly in an environment where non-zero bitssupport not yet supported function. A newer architecture implements anew function using one or more of the reserved bits to identify the newfunction. In an example, these 4 reserved bits (Res) may index into theFCx Table 1108 in order to determine if they are supported as shown forFC bits 1102 in FIG. 10. In this case, the concatenation would be0∥IBC∥FCx for Function codes, and 1∥IBC∥FCx for the new functionpermission test 1103. Instead of the FC 1102 being compared with thepermitted FCs 1107, the Res field of the instruction 905 would bechecked against the permitted FCs bits 1107 to determine 1103 if thefunction is permitted.

In another embodiment, the Res field of the instruction 905 could beconcatenated as if it were a third OpCode extension of 905 OpCodes toindex into the Opcode Table 907 to determine if the function introducedwith the field is permitted.

As a part of or subsequent to, the fetching of an instruction, a CPU maydetermine certain attributes of the instruction, for example, number ofoperands, type of operands (storage or register), operand alignmentrequirements, and authorization requirements. In an emulationenvironment, this determination may be the result of a simple tablelook-up using the operation code as an index; in a high-performance CPU,the determination may be built into the instruction-decode circuitry ofthe processor.

The virtual-architecture-level facility introduces an additionalattribute associated with each instruction: the machine level at whichthe instruction was first introduced to the architecture. This machinelevel may be encoded numeric point on a continuum (for example, 10.2,meaning the 10th-generation machine at the second firmware level), or itmay simply be a value relative to the most-recent machine level (forexample, 2 [or −2], meaning that the instruction was introduced twomachine generations prior to the current machine).

Referring to FIG. 12 in an embodiment, selected installed functions of amulti-function instruction are hidden, the multi-function instructionarchitected to perform a function of a plurality of installed functions,the hiding comprising setting 1201 a value controlling availability ofinstalled functions to a multi-function instruction of a Host computercomprising one or more processors, a processor having a first pluralityof said installed functions of the multi-function instruction, the firstplurality of installed functions comprising one or more first installedfunctions and one or more second installed functions, and executing 1202a multi-function instruction, the multi-function instruction comprisingan opcode field, the execution comprises responsive to themulti-function instruction specifying a query function, performing thequery function to determine installed functions available to themulti-function instruction; the query function execution uses the valueto determine the one or more second installed functions; and the queryfunction execution stores 1203 a result value indicating one or more ofthe one or more second installed functions are not available to themulti-function instruction.

Referring to FIG. 13, in an embodiment, the value is set 1301 by ahypervisor of the Host computer for a virtual machine of the Hostcomputer, the virtual machine comprising one or more logical processors,the one or more logical processors being assigned to one or morephysical processors, a physical processor having the one or more secondinstalled functions of the multi-function instruction, wherein themulti-function instruction is executed in the virtual machine by alogical processor of one or more logical processors on a physicalprocessor of the one or more physical processors.

In an embodiment, the one or more second installed functions isdetermined 1302 based on the opcode of the multi-function instruction.

Referring to FIG. 14, in an embodiment, the hypervisor having set 1201 acontrol value in a virtual machine, sets 1401 another value controllingavailability of installed functions to a multi-function instructionexecuting on another virtual machine of the Host computer system; andanother multi-function instruction is executed 1402 in the anothervirtual machine by another logical processor of one or more anotherlogical processors; responsive to the another multi-function instructionspecifying another query function, the another query function isperformed to determine installed functions available to the anothermulti-function instruction; the another query function execution usesthe another value to determine one or more third installed functions;and the another query function execution stores 1403 another resultvalue indicating one or more of the one or more third installedfunctions are not available to the another multi-function instruction.

In an embodiment, the stored result value is a bit significant value,where each bit position corresponds to a function, and a bit being 1indicates the corresponding function is installed.

Referring to FIG. 15, in an embodiment, the query function is specifiedby a multi-function instruction specified function code 1501 or amulti-function instruction specified test bit 1502.

Referring to FIG. 16, in an embodiment, the multi-function instructionis a zArchitecture instruction consisting of any one of a 1601cryptographic instruction, a Perform Timing Facility Functioninstruction, or FIG. 17 any one of 1701 Perform Floating Point Operationinstruction or a Perform Locked Operation instruction, wherein thecryptographic instruction comprises any one of a Cipher Messageinstruction, a Compute Intermediate Message instruction, a Compute LastMessage Digest instruction, a Compute Last Message Digest instruction, aCompute Message Authentication Code instruction, wherein themulti-function instruction specifies a query function; responsive to themulti-function instruction being a cryptographic instruction or a PTFFinstruction; the multi-function instruction specified function code tobe executed is obtained 1602, the obtained function code consisting 1605of a query function, wherein the stored 1604 result value based on acontrol value is a plurality of bits, each bit of the plurality of bitsindicating whether a corresponding function code is supported; andresponsive to the multi-function instruction being a cryptographicinstruction or a PTFF instruction, the multi-function instructionspecified function code to be executed is obtained, the obtainedfunction code not being the query function 1605, a cryptographicfunction or a PTFF function is performed 1603 according to the obtainedfunction code; and 1701 responsive to the multi-function instructionbeing the Perform Locked Operation instruction or the Perform FloatingPoint Operation instruction and the multi-function instruction specifiedtest bit is 1 1702, a determination 1704 is made whether amulti-function instruction specified function code is installed based onthe control value, wherein the stored result value 1704 is a conditioncode value; and responsive to the multi-function instruction being thePerform Locked Operation instruction or the Perform Floating PointOperation instruction and the multi-function instruction specified testbit is 0 1702, a Floating Point function or a locked operation isperformed 1703 according to the obtained function code.

In an embodiment, responsive to the multi-function instructionspecifying a non-query function of the first plurality of said installedfunctions, responsive to the non-query function being one of said secondinstalled functions, the non-query function is performed, and responsiveto the non-query function being a function other than one of said secondinstalled functions, performance said non-query function is blocked.

The forgoing may be useful in understanding the terminology andstructure of one computer system embodiment. Embodiments may be notlimited to the z/Architecture or to the description provided thereof.Embodiments can be advantageously applied to other computerarchitectures of other computer manufacturers with the teaching herein.

While preferred embodiments have been illustrated and described herein,it may be to be understood that embodiments may be not limited to theprecise construction herein disclosed, and the right may be reserved toall changes and modifications coming within the scope of the inventionas defined in the appended claims.

1. A computer implemented method for hiding selected installed functionof a multi-function instruction, the multi-function instructionarchitected to perform a function of a plurality of installed functions,the method comprising: setting a control value configured to controlavailability of installed functions to a multi-function instruction of aHost computer comprising one or more processors, each of said one ormore processors having a plurality of said installed functions, thefirst plurality of installed functions comprising one or more firstinstalled functions and one or more second installed functions: andbased on the control value, making the one or more first installedfunctions of a processor unavailable to the multi-function instructionand the one or more second installed functions of the processoravailable to the multi-function instruction; and executing amulti-function instruction, the multi-function instruction comprising anopcode field, the execution of the multi-function instructioncomprising: responsive to the multi-function instruction specifying aquery function, performing the query function, the preforming the queryfunction comprising: using the control value to determine the one ormore first installed functions are unavailable and the one or moresecond installed functions are available; and storing a result valueindicating the one or more first installed functions are not availableto the multi-function instruction and the one or more second installedfunctions are available to the multi-function instruction; andresponsive to the multi-function instruction specifying a non-queryfunction of the first plurality of said installed functions, performinga)-b): a) responsive to the non-query function being one of said secondinstalled functions, performing the non-query function; and b)responsive to the non-query function being one of said first installedfunctions blocking performing said non-query function.
 2. The methodaccording to Claim 1, wherein the control value is set by a hypervisorof the Host computer for a virtual machine of the Host computer, thevirtual machine comprising one or more logical processors, the one ormore logical processors being assigned to_one or more physicalprocessors, a physical processor having the first plurality of installedfunctions of the multi-function instruction, wherein the multi-functioninstruction is executed in the virtual machine by a logical processor ofone or more logical processors on a physical processor of the one ormore physical processors.
 3. The method according to Claim 2, whereinmaking the one or more first installed functions of a processorunavailable to the multi-function instruction and the one or more secondinstalled functions of the processor available to the multi-functioninstruction is based on the opcode of the multi-function instruction. 4.The method according to Claim 2, further comprising: setting by thehypervisor, another control value configured to control availability ofinstalled functions to a multi-function instruction executing on anothervirtual machine of the Host computer; and based on the other controlvalue, making one or more third installed functions of a processorunavailable to another multi-function instruction and the one or morefourth installed functions of the processor available to the othermulti-function instruction: and executing the other a multi-functioninstruction on the other virtual machine by another logical processor ofthe one or more other logical processors, the other multi-functioninstruction comprising another opcode field: responsive to the othermulti-function instruction specifying another query function, performingthe other query function, the performing the other query functioncomprising: using the other control value to determine the one or morethird installed functions are unavailable and the one or more fourthinstalled functions are available; and storing another result valueindicating the one or more third installed functions are not availableto the other multi-function instruction and the one or more fourthinstalled functions are available are available to the othermulti-function instruction.
 5. The method according to Claim 2, whereinthe stored result value is a bit significant value, wherein each bitposition corresponds to a function, and a bit being 1 indicates that thecorresponding function is available to the multi-function instruction.6. The method according to Claim 1, wherein the query function isspecified by a function code specified by the multi-function instructionor by a bit specified by the multi-function instruction.
 7. The methodaccording to Claim 6, wherein the multi-function instruction is azArchitecture instruction consisting of any one of a cryptographicinstruction, a Perform Timing Facility Function (PTFF) instruction,Perform Floating Point Operation instruction or a Perform LockedOperation instruction, wherein the cryptographic instruction comprisesany one of a Cipher Message instruction, a Cipher Message with Chaininginstruction, a Compute Intermediate Message Digest instruction, aCompute Last Message Digest instruction or a Compute MessageAuthentication Code instruction, and wherein execution of themulti-function instruction specifying a query function comprises:responsive to the multi-function instruction being a cryptographicinstruction or a PTFF instruction, obtaining the function code specifiedby the multi-function instruction to be executed, responsive to theobtained function code specifying the query function, wherein the storedresult value is a plurality of bits, each bit of the plurality of bitsindicating whether a corresponding function is available to themulti-function instruction; and responsive to the obtained function codenot specifying the query function, performing a cryptographic functionor a PTFF function according to the obtained function code; andresponsive to the multi-function instruction being the Perform LockedOperation instruction or the Perform Floating Point Operationinstruction and the multi-function instruction specified test bit being1, determining that a multi-function instruction specified function codeis installed, wherein the stored result value is a condition code value;and responsive to the multi-function instruction being the PerformLocked Operation instruction or the Perform Floating Point Operationinstruction and the multi-function instruction specified test bit being0, performing a Floating Point operation or a locked operation accordingto the obtained function code.
 8. A computer system for hiding selectedinstalled function of a multi-function instruction, the multi-functioninstruction architected to perform a function of a plurality ofinstalled functions, comprising: a memory; a processor in communicationwith the memory, the processor comprising an instruction fetchingelement for fetching instructions from memory and one or more executionelements for executing fetched instructions; wherein the computer systemis configured to perform a method comprising: setting a control valueconfigured to control availability of installed functions to amulti-function instruction of a Host computer comprising one or moreprocessors, each of said one or more processors having a plurality ofsaid installed functions, the first plurality of installed functionscomprising one or more first installed functions and one or more secondinstalled functions; and based on the control value, making the one ormore first installed functions of a processor unavailable to themulti-function instruction and the one or more second installedfunctions of the processor available to the multi-function instruction;and executing a multi-function instruction, the multi-functioninstruction comprising an opcode field, the execution of themulti-function instruction comprising: responsive to the multi-functioninstruction specifying a query function, performing the query function,the performing the query function comprising: using the control value todetermine the one or more first installed functions are unavailable andthe one or more second installed functions are available; and storing aresult value indicating the one or more first installed functions arenot available to the multi-function instruction and the one or moresecond installed functions are available to the multi-functioninstruction; and responsive to the multi-function instruction specifyinga non-query function of the first plurality of said installed functions,performing a)-b): a) responsive to the non-query function being one ofsaid second installed functions, performing the non-query function; andb) responsive to the non-query function being one of said firstinstalled functions, blocking performing said non-query function.
 9. Thecomputer system according to Claim 8, wherein the control value is setby a hypervisor of the Host computer for a virtual machine of the Hostcomputer, the virtual machine comprising one or more logical processors,the one or more logical processors being assigned to_one or morephysical processors, a physical processor having the first plurality ofinstalled functions of the multi-function instruction, wherein themulti-function instruction is executed in the virtual machine by alogical processor of one or more logical processors on a physicalprocessor of the one or more physical processors.
 10. The computersystem according to Claim 9, wherein making the one or more firstinstalled functions of a processor unavailable to the multi-functioninstruction and the one or more second installed functions of theprocessor available to the multi-function instruction is based on theopcode of the multi-function instruction.
 11. The computer systemaccording to Claim 9, further comprising: setting by the hypervisor,another control value configured to control availability of installedfunctions to a multi-function instruction executing on another virtualmachine of the Host computer; and based on the other control value,making one or more third installed functions of a processor unavailableto another multi-function instruction and the one or more fourthinstalled functions of the processor available to the othermulti-function instruction: and executing the other a multi-functioninstruction on the other virtual machine by another logical processor ofthe one or more other logical processors, the other multi-functioninstruction comprising another opcode field; responsive to the othermulti-function instruction specifying another query function, performingthe other query function, the performing the other query functioncomprising: using the other control value to determine the one or morethird installed functions are unavailable and the one or more fourthinstalled functions are available; and storing another result valueindicating the one or more third installed functions are not availableto the other multi-function instruction and the one or more fourthinstalled functions are available are available to the othermulti-function instruction.
 12. The computer system according to Claim9, wherein the stored result value is a bit significant value, whereineach bit position corresponds to a function, and a bit being 1 indicatesthat the corresponding function is available to the multi-functioninstruction.
 13. The computer system according to Claim 8, wherein thequery function is specified by a function code specified by themulti-function instruction or by a bit specified by the multi-functioninstruction.
 14. The computer system according to Claim 13, wherein themulti-function instruction is a zArchitecture instruction consisting ofany one of a cryptographic instruction a Perform Timing FacilityFunction (PTFF) instruction, Perform Floating Point Operationinstruction or a Per-form Locked Operation instruction, wherein thecryptographic instruction comprises any one of a Cipher Messageinstruction, a Cipher Message with Chaining instruction, a ComputeIntermediate Message Digest instruction, a Compute Last Message Digestinstruction or a Compute Message Authentication Code instruction, andwherein execution of the multi-function instruction specifying a queryfunction comprises: responsive to the multi-function instruction being acryptographic instruction or a PTFF instruction, obtaining the functioncode specified by the multi-function instruction to be executed,responsive to the obtained function code specifying the query function,wherein the stored result value is a plurality of bits, each bit of theplurality of bits indicating whether a corresponding function isavailable to the multi-function instruction; and responsive to theobtained function code not specifying the query function, performing acryptographic function or a PTFF function according to the obtainedfunction code; and responsive to the multi-function instruction beingthe Per-form Locked Operation instruction or the Perform Floating PointOperation instruction and the multi-function instruction specified testbit being 1, determining that a multi-function instruction specifiedfunction code is installed, wherein the stored result value is acondition code value; and responsive to the multi-function instructionbeing the Perform Locked Operation instruction or the Perform FloatingPoint Operation instruction and the multi-function instruction specifiedtest bit being 0, performing a Floating Point operation or a lockedoperation according to the obtained function code.
 15. A computerprogram product for hiding selected installed function of amulti-function instruction, the multi-function instruction architectedto perform a function of a plurality of installed functions, thecomputer program product comprising a tangible storage medium readableby a processing circuit and storing instructions for execution by theprocessing circuit for performing a method comprising: setting a controlvalue configured to control availability of installed functions to amulti-f unction instruction of a Host computer comprising one or moreprocessors, each of said one or more processors having a plurality ofsaid installed functions, the first plurality of installed functionscomprising one or more first installed functions and one or more secondinstalled functions; and based on the control value, making the one ormore first installed functions of a processor unavailable to themulti-function instruction and the one or more second installedfunctions of the processor available to the multi-function instruction;and executing a multi-function instruction, the multi-functioninstruction comprising an opcode field, the execution of themulti-function instruction comprising: responsive to the multi-functioninstruction specifying a query function, performing the query function,the performing the query function comprising: using the control value todetermine the one or more first installed functions are unavailable andthe one or more second installed functions are available; and storing aresult value indicating the one or more first installed functions arenot available to the multi-function instruction and the one or moresecond installed functions are available to the multi-functioninstruction; and responsive to the multi-function instruction specifyinga non-query function of the first plurality of said installed functions,performing a)-b): a) responsive to the non-query function being one ofsaid second installed functions, performing the non-query function; andb) responsive to the non-query function being one of said firstinstalled functions, blocking performing said non-query function. 16.The computer program product according to claim 15, wherein the controlvalue is set by a hypervisor of the Host computer for a virtual machineof the Host computer, the virtual machine comprising one or more logicalprocessors, the one or more logical processors being assigned to_one ormore physical processors, a physical processor having the firstplurality of installed functions of the multi-function instruction,wherein the multi-function instruction is executed in the virtualmachine by a logical processor of one or more logical processors on aphysical processor of the one or more physical processors.
 17. Thecomputer program product according to claim 16, wherein making the oneor more first installed functions of a processor unavailable to themulti-function instruction and the one or more second installedfunctions of the processor available to the multi-function instructionis based on the opcode of the multi-function instruction.
 18. Thecomputer program product according to claim 16, further comprising:setting by the hypervisor, another control value configured to controlavailability of installed functions to a multi-function instructionexecuting on another virtual machine of the Host computer; and based onthe other control value, making one or more third installed functions ofa processor unavailable to another multi-function instruction and theone or more fourth installed functions of the processor available to theother multi-function instruction: and executing the other amulti-function instruction on the other virtual machine by anotherlogical processor of the one or more other logical processors, the othermulti-function instruction comprising another opcode field; responsiveto the other multi-function instruction specifying another queryfunction, performing the other query function, the performing the otherquery function comprising: using the other control value to determinethe one or more third installed functions are unavailable and the one ormore fourth installed functions are available; and storing anotherresult value indicating the one or more third installed functions arenot available to the other multi-function instruction and the one ormore fourth installed functions are available are available to the othermulti-function instruction.
 19. The computer program product accordingto claim 16, wherein the stored result value is a bit significant value,wherein each bit position corresponds to a function, and a bit being 1indicates that the corresponding function is available to themulti-function instruction.
 20. The computer program product accordingto Claim 15, wherein the query function is specified by a function codespecified by the multi-function instruction or by a bit specified by themulti-function instruction.
 21. The computer program product accordingto Claim 20, wherein the multi-function instruction is a zArchitectureinstruction consisting of any one of a cryptographic instruction, aPerform Timing Facility Function (PTFF) instruction, Perform FloatingPoint Operation instruction or a Per-form Locked Operation instruction,wherein the cryptographic instruction comprises any one of a CipherMessage instruction, a Cipher Message with Chaining instruction, aCompute Intermediate Message Digest instruction, a Compute Last MessageDigest instruction or a Compute Message Authentication Code instruction,and wherein execution of the multi-function instruction specifying aquery function comprises: responsive to the multi-function instructionbeing a cryptographic instruction or a PTFF instruction, obtaining thefunction code specified by the multi-function instruction to beexecuted, responsive to the obtained function code specifying the queryfunction, wherein the stored result value is a plurality of bits, eachbit of the plurality of bits indicating whether a corresponding functioncode is available to the multi-function instruction; and responsive tothe obtained function code not specifying the query function, performinga cryptographic function or a PTFF function according to the obtainedfunction cede; and responsive to the multi-function instruction beingthe Perform Locked Operation instruction or the Perform Floating PointOperation instruction and the multi-function instruction specified testbit being 1, determining that a multi-function instruction specifiedfunction code is installed, wherein the stored result value is acondition code value; and responsive to the multi-function instructionbeing the Perform Locked Operation instruction or the Perform FloatingPoint Operation instruction and the multi-function instruction specifiedtest bit being 0, performing a Floating Point operation or a lockedoperation according to the obtained function code.